Workbench package dependency migration - php

I'm developing a package (under workbench) which depends on another package (https://github.com/efficiently/authority-controller) for user role management. For this package to work, I need to run a migration initially. But however when I run the command php artisan migrate --package=machuga/authority-l4, it says Nothing to migrate.
I tried running php artisan dump-autoload from the root, and also php artisan migrate --bench=machuga/authority-l4 but nothing seems to work.

Try add Authority\AuthorityL4\AuthorityL4ServiceProvider to your providers and run:
php artisan migrate --package=machuga/authority-l4
I think, efficiently/authority-controller depends on machuga/authority, but doesn't call the provider.

Related

Laravel 8 UI issue

I have installed Laravel 8 as a new project. When I run the project I get the "In order to use the Auth::routes() method, please install the laravel/ui package." But Laravel installation doc says that laravel ui is depreciated and that we should use Jetstream. So I installed Jetstream with the Livewire stack. Back to test the project and I get the same error msg.
I have run a composer dump-autoload.
What do I have to do to get a Laravel 8 project to run?
You will need to clear and recreate cache. Run the following php artisan commands:
php artisan cache:clear
php artisan config:cache
php artisan route:cache
I had this problem as well on many 'upgrades' from earlier versions of Laravel. I don't want to change the entire auth mechanism, as it works, so I will keep the code I have.
#Elisha Senoo's answer is correct, and solved it most of the time. However, if you find yourself unable to clear the cache (because it has the same error message on the artisan command), the solution is to manually clear the .php files within the bootstrap/cache folder and then php artisan config:cache.

How can create a telescope with migrate

I have successfully installed Telescope:
C:\Users\USER\p3>php artisan telescope:install
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.
However, when I use: php artisan migrate, it says nothing was migrated. I also tried php artisan migrate:fresh, all the table were created but no telescope!!
C:\Users\USER\p3>php artisan migrate
Nothing to migrate.
Please any help?

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

Laravel's "artisan vendor:publish" not publishing anything but returns "Publishing complete"

Today I installed Torann's GeoIP package for Laravel. The require me to run php artisan vendor:publish in the projects directory, so I could publish Torann's config file alongside my application's config files. When I execute it it returns "Publishing complete" however, nothing is actually published. The service provider IS added to config/app.php. I am using a shared hosting running Linux, if that matters. Any help is appreciated!
Try this:
php artisan vendor:publish --provider="Torann\GeoIP\GeoIPServiceProvider" --tag=config --force

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