Following all the instructions in the document of dusterio / lumen-passport,
Running php artisan passport:install after all the instructions in the document gives me the following error.
Encryption keys generated successfully.
Personal access client created successfully.
Client ID: 1
Client secret: EQXIlANzcONLH7IvXOi6bRuSHxOqemZVKjMOHC5I
In ChoiceQuestion.php line 36:
Choice question must have at least 1 choice available.
Been on this the entire night.
First of all, I guess you have followed this documentation.
This type of error comes when $app->configure('auth'); could not find the auth.php at <YOUR_PROJECT>/config/auth.php.
While make mistake to put the config directory in app viz. <YOUR_PROJECT>/app/config/auth.php
Check the config directory location, it must be just under the project's root directory.
STEP 1: Add $app->configure('auth'); in your bootstrap\app.php
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(Laravel\Passport\PassportServiceProvider::class);
$app->register(Dusterio\LumenPassport\PassportServiceProvider::class);
$app->configure('auth');
STEP 2: Go to file vendor\laravel\lumen-framework\config\auth.php and change the 'guards' and 'providers'
'guards' => [
'api' => [
'driver' => 'passport',
'provider' => 'users'
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \App\Models\User::class
]
],
STEP 3: Run php artisan migrate:fresh
STEP 4: Run php artisan passport:install --force
Related
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
I putted file on project-dir/client_secret_1***.apps.googleusercontent.com.json and then added variable into env file.
GOOGLE_PLAY_CREDENTIAL=http://local.project-dir/client_secret_1***.apps.googleusercontent.com.json
and then in config/services.php
return [
'google_play' => [
'credential' => env('GOOGLE_PLAY_CREDENTIAL'),
],
];
So now when I use it as like below
$client->setAuthConfig(config('services.google_play.credential'));
it is returning error which is
"file "http://local.project-dir/client_secret_1***.apps.googleusercontent.com.json" does not exist"
Can someone kindly guide me, where I am wrong so that I can fix the issue. I would like to appreciate.
Thanks
Use Laravel Storage.
Edit config/filesystems.php to create new disk:
'services' => [
'driver' => 'local',
'root' => storage_path('app/services'),
],
// ...
Put your .json file into %your_project_root%/storage/app/services/
Edit .env file:
GOOGLE_PLAY_CREDENTIAL=client_secret_1***.apps.googleusercontent.com.json
Change setAuthConfig param:
$client->setAuthConfig(Storage::disk('services')->get(config('services.google_play.credential')));
Test your storage using Tinker in console:
php artisan tinker
Storage::disk('services')->get(config('services.google_play.credential'));
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');
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
When I'll try to check if a file exists in Laravel 5.1 I am always getting this error:
ErrorException in Local.php line 95:
mkdir(): File exists
I don't know what could here be wrong, I want to check if a file exists or not with:
$exists = Storage::disk('images')->has('filename.jpg');
dd($exists);
Disk "images":
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path().'/app',
],
'images' => [
'driver' => 'local',
'root' => storage_path().'/app/images',
],
Any ideas?
If I were you, I would try fresh installation to verify if you experience the same problem on fresh installation:
composer create-project laravel/laravel testfiles 5.1.*
add into filesystems.php in disks:
'images' => [
'driver' => 'local',
'root' => storage_path().'/app/images',
],
Modify in Http/routes.php file so root path looks like this:
Route::get('/', function () {
$exists = Storage::disk('images')->has('filename.jpg');
dd($exists);
return view('welcome');
});
Of course you need to also set up domain for this sample project.
On mine PC I'm getting false without any error.
If you have this error on fresh install, well, it's a problem, if not, maybe you could also publish your composer.json and composer.lock files to verify it on exact libarries you are using?