Laravel - Driver [] is Not Supported - php

I haven't found an example like mine, the others appear to be missing what I already have but anyways, I'm trying to upload to an external FTP site, to which I have the following in my filesystem.php file:
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
],
'fourkites-ftp' => [
'driver' => 'ftp',
'host' => 'ftp.site.com',
'username' => 'my-username',
'password' => 'my-password',
],
And I'm trying to send the file along with the following in one of my controllers:
Storage::disk('fourkites-ftp')->put('new/afnloads.csv', $temp);
And as I'm trying testing it, it gives me this error:
(1/1) InvalidArgumentException
Driver [] is not supported.
in FilesystemManager.php line 126
Are there any suggestions? Thanks!

Most probably config cached.
Try clear using
php artisan config:clear

I have solved my problem by following commands
php artisan cache:clear
php artisan config:clear
php artisan clear-compiled

It helped me adding this line to bootstrap/app.php (in 'Create The Application' section)
$app->configure('filesystems');

Related

The 'username' key is missing from the given credentials array

Laravel Version: 9.11
Adldap2-Laravel Version: 6.1.6
PHP Version: 6.1.6
LDAP Type: ActiveDirectory
Description:
I'm trying to Authenticate to my Active Directory with Laravel project. But i faced to this error message The 'username' key is missing from the given credentials array when i try to log in.
Steps i've followed:
composer require adldap2/adldap2-laravel
Adldap\Laravel\AdldapServiceProvider::class,
Adldap\Laravel\AdldapAuthServiceProvider::class,
'Adldap' => Adldap\Laravel\Facades\Adldap::class,
php artisan vendor:publish
in the file ldap.php i made this changes
'hosts' => explode(' ', env('LDAP_HOSTS', '...')),
'base_dn' => env('LDAP_BASE_DN', 'DC=host,DC=com'),
'username' => env('LDAP_USERNAME', 'Admin_username'),
'password' => env('LDAP_PASSWORD', 'Admin_password''),
auth.php
'providers' => [
'users' => [
'driver' => 'ldap', // Was 'eloquent'.
'model' => App\User::class,
],
also ENV.
LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_HOST='...'
LDAP_USERNAME=''
LDAP_PASSWORD=''
LDAP_PORT=389
LDAP_BASE_DN="DC=*,DC="
LDAP_TIMEOUT=5
LDAP_SSL=false
LDAP_TLS=false
then i use the command php artisan adldap:import it shows me that
Found 418 user and when i want to import them successfully imported
/ synchronized 0 user(s) also i tested if the connexion is working
with php native and that's worked.
Can someone help me ?
Thanks

Laravel smlink not found

I upload my laravel website to shared hosting ". Every things work except i am not able to retrieve images stored in the storage/public folder. I ran
"php artisan storage:link"
but it says not found. I also tried
rm storage
but the getthe message rm: cannot remove. Is directory
php artisan storage:link output from ssh command
Note, I'm not addressing the original answer because it doesn't sound like it can be done. This is an alternate solution.
Solution
In your config/filesystems.php file, you'll see the following code (or something similar).
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
To link your public disk to a public directory without using OS symlinks, change the disks['public']['path'] to the public path of your choosing. For example,
'disks' => [
/** -- skipped code **/
'public' => [
'driver' => 'local',
'root' => __DIR__ . '../public/images/`,
'url' => env('APP_URL').'/images',
'visibility' => 'public',
],
/** -- skipped code **/
],
Another Solution
You can totally use the S3 storage as well. That will connect you with an AWS bucket that you can use.
Personal Anecdote
Shared hosting can be tricky with Laravel. I would transition away as soon as I could. I use Laravel Forge to deploy servers and Digital Ocean or AWS for hosting.

Created laravel symlink on webserver still can't access the file without app/public

The project is running fine on local but on web server (running on sub domain) when I created symlink using php artisan storage:link or even ln -s full_path/storage/app/public full_path/public/storage through ssh, the symlink got created but I still can't access images inside my storage/app/public without "app/public"
eg: I can access http://xyz.abc.com/storage/app/public/35/conversions/retro1-thumb.jpg
but I can't access http://xyz.abc.com/storage/35/conversions/retro1-thumb.jpg
What I have already tried:
Deleted storage and ran php artisan storage:link - no help
Updated htaccess to follow symlink in root and public - no help
Run php artisan config:clear , php artisan config:cache, php artisan cache:clear - no help
Updated config/filesystem.php with real path as storage and url - no help
Approached host support - no help
Did extensive google search - no help
Here's my config/filesystems.php disk conf-
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
],
],
Hope it can be resolved.
try the following:
1.) config/filesystems.php change root
2.) in public folder , remove storege folder and run php artisan storage:link
3.) Check if symbolic link is enabled in your server

How to enable mount network disk in elfinder laravel for google drive

I have question of elfinder, how to enable 'Mount Network Disk' on elfinder for use google drive in laravel 5.2. Could tell you me, which are steps to follow.
The steps i followed were:
Installation with composer.
composer require barryvdh/laravel-elfinder
Add the ServiceProvider to the providers array in app/config/app.php
Barryvdh\Elfinder\ElfinderServiceProvider::class
Copy the assets to the public folder, using the following artisan command:
php artisan elfinder:publish
Run command.
composer update
I used the default configuration, I created the folder 'files' in the public folder.
With the command
php artisan vendor:publish --provider='Barryvdh\Elfinder\ElfinderServiceProvider' --tag=config
and
php artisan vendor:publish --provider='Barryvdh\Elfinder\ElfinderServiceProvider' --tag=views
In the file elfinder.php with the route
'vendor/barryvdh/laravel-elfinder/config/elfinder.php'
In the section route use
'route' => [
'prefix' => 'elfinder',
'middleware' => null, //Set to null to disable middleware filter
]
In the file filesystems.php with the route
'/config/filesystems.php'.
In the section disk in the option public, add the line
'root' => base_path().'app/public',
after of the line
'driver' => 'local',
Example:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => base_path().'app/public',
'root' => storage_path('app/public'),
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],
],
This is how i solved the error that occurs when you use the copy option, open folder, etc.
Error, Unable to connect to backend. HTTP error 0
But I do not know, what is needed to use the mount network disk.And
how to give the folder(example: Reading)
This is link of the project
https://github.com/AlonsoCauich/driveOne

Voyager admin panel on Laravel 5.3 could not find a storage symlink

Help guys: I tried to test the new Laravel admin and got the following error:
Missing storage symlink We could not find a storage symlink. This
could cause problems with loading media files from the browser.
I tried to use:
php artisan storage:link
Set in Nginx config:
disable_symlinks off;
But it still is not working.
Delete first the existing storage link in public.
after, re-run (in app path)
php artisan storage:link
I have fixed the image issue by editing config/filesystems.php
change the 'public' => root & url value as per your project.. i think it will fix it..
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('../../public_html/images'),
'url' => env('APP_URL').'/images',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
],
],
Having struggled with this symbolic link, here is the procedure:
Once the installation is done on the production server:
cd public
rm storage
Go to the admin panel of Voyager and click on Fix It. Do not use the PHP command artisan storage:link.
Everything works now.

Categories