Laravel Lighthouse Config - unable to locate publishable resources - php

I have installed the latest version of Lighthouse into my Laravel 7 app and it's been working fine with the out-of-the-box config. I now want to tweak some settings for better security, so as per the docs I have tried to use the following command:
php artisan vendor:publish --tag=lighthouse-config
to publish the config file. But I get the following error:
Unable to locate publishable resources.
Publishing complete.
No lighthouse.php file is published to the config folder. Any ideas how to fix this?

Just tried it in an example project and it worked just fine.
A simple workaround is to run:
cp vendor/nuwave/lighthouse/src/lighthouse.php config/lighthouse.php

Laravel 8 Lighthouse Config:
just run php artisan vendor:publish and choose the class that you want to publish.
it's work for me on Laravel 8

Related

Artisan publish Sanctum without a migration file

Sanctum Version: 2.15
Laravel Version: 9.11
PHP Version: 8.0.2
Database Driver & Version: mysql
Description:
I publish Sanctum did not generate the configuration
Steps To Reproduce:
The Laravel Sail development environment was used
into the shell and perform
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
prompt
Copied Directory [/vendor/laravel/sanctum/database/migrations] To [/database/migrations] Publishing complete.
But there are no migration files generated under my migrations directory
Later, I checked the directory permission and found no problem.
Although it can be added manually, I still want to know where this problem can be investigated, because I did not see it mentioned in the document

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.

php artisan horizon:install returns "Could not open input file: artisan"

I've seen answers for this question, but I'm still really confused, because answers say I need to be in my Laravel's project folder, which I thought I had created.
I'm trying to run the command php
php artisan horizon:install
This is the second step in the Laravel installation guide found here: https://laravel.com/docs/7.x/horizon#installation
My directory structure looks like this in my documents folder in Mac OS:
I've tried running the command in the RetimeWeb, vendor, bin, laravel and horizon folders. What am I doing wrong here? Where is an artisan folder supposed to be?
Laravel Horizon is dashboard for managing queues (jobs) in Laravel that supposed to be installed on top of Laravel project.
Based on your directory structure you installed Horizon from composer alone. Now you are trying to run command "php artisan horizon:install" but artisan is a tool from Laravel.
"horizon:install" supposed to copy all assets, configs etc to Laravel project - but again, you do not have any so there is not even where to copy it.
To summary.
Install Laravel.
Install Laravel Horizon.
Do cd until you're in the root folder of your project and run the command again. artisan file is in the root folder of a laravel project

Voyager - Admin Panel Package for Laravel

I am having problem on laravel - Voyager admin panel package installation command. When I put this command php artisan voyager:install a notification show on terminal:
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "storage" namespace.
After this php artisan servecommand I found my admin panel but its show a problem, following screen are showing after submitting log in by default password.
GitHub repository for this Package/Doc
Try using this instead of php artisan voyager:install:
composer.phar dump-autoload
php artisan db:seed
This may help you.
Dont forget to add
TCG\Voyager\VoyagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
into your config/app.php file in the 'providers' => [ array
You are probably installing this on a version of Laravel 5.2 or earlier. Laravel 5.2 does not have the artisan command to create a symlink. Can you check your Laravel version :)
Solution also posted here: https://devdojo.com/forums/discussion/php/voyager-voyager-e-for-laravel-admin-panel-package-for-laravel
Thanks.
If you instaled Voyager on laravel 5.3, you need to add
TCG\Voyager\VoyagerServiceProvider::class,
to your config/app.php at your PROVIDER and it will work.

Auth resources are missing in laravel

I want to make use of auth system which comes with the laravel package but the problem is when I make new laravel package using composer i.e composer create-project laravel/laravel project name --prefer-dist
it do not install those auth resources which includes (i.e. auth folder inside resources > views) and also I can't find the Services Folder inside app directory.
All other things are working fine except this authentication system.
What can be the possible problems? Please give me solution
I am working with MAMP.
Taylor Otwell has made it opt-in for Laravel 5.1
You need to run following command after installation
php artisan scaffold:auth
UPDATE
I think this has been answered here
You could also run the command php artisan make:auth in the root directory of you laravel project. I had the same problem and it worked for me.
The command php artisan scaffold:auth didn't work for me i don't know why.
it issued the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "auth" is not defined.
Did you mean this?
make:auth
in Laravel 5.2 you just have to run this command "php artisan make:auth" and the auth folder will be created
Since laravel 6.* version make:auth is no longer supported, use ui:auth instead.
For deploying ui pack run
composer require laravel/ui --dev
then update composer.json :
composer update -W
and do the:
php artisan ui:auth
You need execute
php artisan make:auth
now if your style css and js are missing
You need load file .css and .js
1) execute in your project
npm install
2) then execute
npm run dev => now in folder /public now exist folder js and css
3) reload page

Categories