Category : laravel-7

I’m using Laravel 7 with Sanctum as my authentication driver, however I have defined my own login, logout, forgotten password etc routes because I wanted to include them in my API namespace, not within the web routes as is default for Laravel. Previously, I was using the standard Laravel UI HTML forms and Passport for ..

Read more

I’m trying to access a database (which exists on a different server) on my Laravel application. I keep getting the following error: SQLSTATE[HY000] [2002] Permission denied My .env file is set up as follows (changed a bit to protect privacy): DB_CONNECTION=mysql DB_HOST= IP_ADDRESS DB_PORT=3306 DB_DATABASE=DB_NAME DB_USERNAME="laravel_user" DB_PASSWORD="password" I’m not sure if this is important or ..

Read more

I have a Laravel Controller Function file_fetch() public function file_fetch(Request $request) { $file = request(‘routename’); $destinationPath = public_path(‘/folder/’.$file); if(!File::exists($destinationPath)){ $content = File::get($destinationPath); return view(‘filefetch’, compact(‘file’,’content’)); } else { return redirect(‘/’)->witherrormessage(‘NO such File Exists’); } } This works if i check for file public/folder/app/index.html and if i check for public/newfolder (newfolder doesnt exist) and hence it ..

Read more