Class 'Laraveldaily\Quickadmin\QuickadminServiceProvider' not found for php artisan in Laravel - php

I want to install quickadmin to create a quick admin panel, I am using Laravel 5.3 and I have followed the step to install:
Create new project
composer create-project laravel/laravel ProjectName --prefer-dist
2.Install quickadmin
composer require laraveldaily/quickadmin
Add Laraveldaily\Quickadmin\QuickadminServiceProvider::class, to your \config\app.php providers after App\Providers\RouteServiceProvider::class,
Configure your .env file with correct database information
Run php artisan quickadmin:install and fill the required information.
but this error appear
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Laraveldaily\Quickadmin\QuickadminServiceProvider' not found
What's happend?

I think you left one step and that is clear the cache. Please try after clear the cache.
You can run following command after 3rd step :
php artisan config:cache
php artisan config:clear
php artisan cache:clear

These steps can be followed to install quickadminpanel without any difficulty
composer create-project laravel/laravel ProjectName --prefer-dist
cd ProjectName
php artisan clear-compiled
composer require laraveldaily/quickadmin
php artisan clear-compiled
Open:
config/app.php
insert in the $providers array after Illuminate\View\ViewServiceProvider::class,
Laraveldaily\Quickadmin\QuickadminServiceProvider::class,
Open:
config/app.php
insert
Laraveldaily\Quickadmin\QuickadminServiceProvider::class,
Open:
app/Providers/AppServiceProvider.php
insert after use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
insert in boot() function
Schema::defaultStringLength(191);
Create a database(if you are using something like xampp, create it in phpmyadmin)
Modify .env file to add database configurations, db name(the one which you created),
username(usually root), password
php artisan config:cache
php artisan config:clear
php artisan quickadmin:install
enter admin email and password (will be used to login to quickadminpanel everytime, so choose ones you can easily remember)
Open:
App\Http\Kernel.php
insert in the $routeMiddleware array
'role' => \Laraveldaily\Quickadmin\Middleware\HasPermissions::class,
php artisan serve
Open browser, url: localhost:8000/admin

Related

Laravel vendor:publish not creating the file

Laravel "php artisan vendor:publish" not creating the config file from the package to be copied over to the main project if the file already exist. My problem is that I usually update some configs in my package and running the vendor:publish doesn't copy the file to the main app because I previously executed the command.
php artisan vendor:publish --help would show you the help information for the command. First option is
--force Overwrite any existing files
So use
php artisan vendor:publish --force
to ... overwrite existing files.

php artisan make:auth not defined in Laravel 8

I'm trying to run this command in Laravel 8.57.0 but it's not working:
PHP artisan make:auth
and the error is :
Command "make:auth" is not defined
Did you mean one of these?
make:test
make:request
make:migration
make:seeder
make:middleware
make:controller
make:provider
make:policy
make:event
make:console
make:job
make:listener
make:model
make:command
I also tried
composer require laravel/ui
php artisan ui vue --auth
php artisan migrate
but still have the same error. So, I guess that either I am using the wrong command or I am trying to do something that can not be done. Maybe most likely experienced people will see right away what is wrong.
What are you trying to do exactly? Create the authentication scaffolding from the laravel/ui package?
If so, then these two commands should be enough:
composer require laravel/ui
php artisan ui vue --auth
You can read further about it here.
Since Laravel >= 6, the command php artisan make:auth was removed from the core and moved to an individual package called laravel/ui, so the command now looks like: php artisan ui vue --auth.
Depending on what you want to accomplish I can recommend you the following solutions:
Check this answer, this may be marked as duplicated: php artisan make:auth command is not defined
Run composer dump-autoload and php artisan optimize
Try a different package, like Laravel Fortify
Why don't you try using the fortify package for authentication?
composer require laravel/fortify
The details can be found here.
Why dont you use Laravel Sanctum
composer require laravel/sanctum

Laravel-Permission - permission not found in artisan list - There are no commands defined in the "permission" namespace

Hello Good Developers,
I am using spatie:laravel-permissions package in my application. I have identical code in local machine and production server.
I am having a strange issue with my production environment.
I cannot find permission in list of commands in php artisan list.
When I execute php artisan permission:cache-reset it says
There are no commands defined in the "permission" namespace.
I tried following things to fix this issue
Spatie\Permission\PermissionServiceProvider::class, in app.php
providers
composer update
composer dump-autoload
Cleared all config and application cache.
deleted vendors directory and executed composer install to reinstall all the packages.
Still its not working.
However when I execute dump-autoload it says Discovered Package: spatie/laravel-permission
I am using Laravel 5.7.28 and spatie/laravel-permission:^2.5
My Local system is working fine and I can see permission command in the list there.
Please help! I don't know where should I check now.
Try to run this command:
php artisan optimize:clear
If, for some reason, the command doesn't work, run these one by one:
php artisan view:clear
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan clear-compiled
After one of the above steps, if you are in production environment, run: php artisan config:cache

Fatal error: Class 'LaravelLocalization' not found after composer install in production

It's been 3 days since I'm working on translating my site, so I installed LaravelLocalization:
I did everything working in local, then I pushed it in production and executed:
composer install --no-interaction --no-dev
php artisan clear-compiled
php artisan optimize
composer dump-autoload -o
php artisan route:cache
php artisan config:cache
Now, all the "php artisan commands fail with:"
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Class 'LaravelLocalization' not found
In this case, in the composer install script, it fails in:
php artisan clear-compiled
I tried to run:
php artisan cache:clear
php artisan route:clear
But without any results...
Any ideas??? This is not the first time I get this kind of stuff, but I may say that this it's a pain in the ass :(
EDIT:
In my routes.php,
I deleted this line:
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localeSessionRedirect', 'localizationRedirect']],
around all my routes, and now composer install works.
But it doesn't solve my issue, because as soon as I put it back, I still get the same error :(
I resolved it removing the line:
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localeSessionRedirect', 'localizationRedirect']],
in my file routes.php
run again
composer install
and finally
php artisan config:clear
php artisan route:clear
What I don't know is why it happened, and if there is a way to prevent it...
as what the error says, it means that the composer can't locate your package. so be sure to
check your config/app.php file
be sure to put the package in providers and aliases arrays, respectively.
This has been a known issue for a while, but has actually finally been resolved recently. You can read about the issue here.
Basically, running php artisan loads the entire framework, including the cached files. Since the cached files don't have your service provider, you get the error. This includes running php artisan clear-compiled. So, it is using the cached files in the command that is used to delete the cached files.
This issue has finally been resolved as of laravel/framework:v5.2.25 and laravel/laravel:v5.2.27, and backported to laravel/framework:v5.1.33 and laravel/laravel:v5.1.33.
This fix includes a change to the Laravel application (laravel/laravel), in addition to the Laravel Framework (laravel/framework). To implement, you will need to:
1) Update the scripts section of your composer.json file to match that in the laravel/laravel package. Specifically:
remove the pre-update-cmd section
in the post-install-cmd section, replace "php artisan clear-compiled" with "Illuminate\\Foundation\\ComposerScripts::postInstall"
in the post-update-cmd section, replace "php artisan clear-compiled" with "Illuminate\\Foundation\\ComposerScripts::postUpdate"
2) Once you have updated your composer.json, run a composer update. If you only want to update the framework, you can run composer update laravel/framework.

migrate Laravel Database using artisan

when try to migrate Laravel 4 with table 'user' in database using artisan:
php artisan migrate:make --table="user" CreateUserTable
I receive this error:
C:\xampp\htdocs\laravel>php artisan migrate:make --table=user CreateUserTable
[21.04.2014 02:27:56 NOTICE] Successfully established connection to the database
[21.04.2014 02:27:56 NOTICE] Event Reporting is not allowed at the
moment. Reaso ns: Pre Startup or Post Shutdown
{"error":{"type":"Symfony\Component\HttpKernel\Exception\NotFoundHttpExcepti
on","message":"","file":"C:\xampp\htdocs\laravel\vendor\laravel\framework\
\src\Illuminate\Foundation\Application.php","line":871}}
C:\xampp\htdocs\laravel>
how to solve this?
thanks,
I solved this by install all laravel dependences using composer (not download it from GithHub)
to install all dependencies with composer.
change directory to laravel folder in cmd and than type
composer update
and hit enter and wait until it is done.

Categories