Error happens when I install livewire in laravel - laravel

the error is
#php artisan vendor:publish --tag=laravel-assets --ansi --force No
publishable resources for tag [laravel-assets].

This is not an error With the laravel.
With the relase of Laravel v8.5.23 they have added a command to post-update-cmd inside composer.json. So when ever if you run a composer update. Laravel will publishes the latest assests of the package that is created by them such as horizon and telescope.
So when they make changes in assests in above packages and tagged a release. You can use it by running the composer update command. But the changes made to vue files and styling will not be changed. You need to run the publish command manually. So to fix that they have added tags to those packages and whenever you run a composer update command it will automatically publishes the assets which are tagged as aravel-assets.
The reason you are getting No publishable resources for tag [laravel-assets]. message is either you haven't installed any of the package that uses the tag laravel-assets or may be not update in the assets.
You can view the PR's here
laravel/laravel/pull/5654
laravel/horizon/pull/1045
laravel/telescope/pull/1105

Related

Remove laravel/ui and php artisan ui vue --auth in Laravel 7

I installed the laravel/ui and php artisan ui vue --auth in my laravel projec, but now I want them removed. How do I do it?
Using composer update vendor/package-name didn't work and the auth folders still exist.
You can remove the package by running composer remove laravel/ui but you need to manually need to remove blade and controller files. Also, you need to update the web.php route file.
You can also remove this from composer.json then run the composer update command.
As #Bhagchandani said, first run:
composer remove laravel/ui
And, manually remove each generated controller, blade files, edit route web file,
and in addition to that, remove each generated CSS, SASS, and JavaScript files in /resources (if any).
Then, make sure to remove every dependency related to vue in package.json, and run, to update the node dependencies:
npm i

Publish all contents of a Laravel package

I installed a Laravel package via composer and require some of the non-published controllers of it to be published (to be safely modified by me and still being able to run composer install without overwriting custom code). However, I wouldn't find any appropriate answers on Google.
Basically, php artisan vendor:publish publishes some of the files of the package but not all. Is there a way to modify what files vendor:publish publishes? As stated, I'll need some controllers of the vendor folder to be published.
You can pass in the package's provider class and tags for what you want to publish
php artisan vendor:publish --provider="Namespace\ProviderClass" --tag="config|lang"
Try this out
php artisan vendor:publish --all

Laravel Nova: Build Components

First post.
I'm currently building a Laravel Nova application. I'm making changes to the dashboard component - more specifically the file within the "resources/js/views/Dashboard.vue".
I'm struggling to build the component - does anyone know how to build the component? I have some code which runs webpack.mix to build my JS and SCSS files, but I'm pretty sure it doesn't include the files within the Laravel Nova instance.
Any help will be great.
EXTRA:
I've already tried run the webpack command to build from inside the Laravel Nova instance but it errors out.
UPDATE
I found renaming my webpack.mix.js.dist to webpack.mix.js, running npm run dev whilst within the ./nova directory worked... but only after running php artisan nova:publish
I've wrote a command to compile all these steps but do I have to run php artisan nova:publish everytime, just seems...tedious?
By default, Nova's JavaScript is compiled for production. As such, you will not be able to access the Vue DevTools out of the box without compiling Nova's JavaScript for development. To accomplish this, you may use the following terminal commands from the root of your Nova project:
cd ./vendor/laravel/nova
mv webpack.mix.js.dist webpack.mix.js
npm install
npm run dev
rm -rf node_modules
cd -
php artisan nova:publish
Details: https://nova.laravel.com/docs/2.0/customization/frontend.html#vue-devtools

Remove a package from laravel

I installed this Cartalyst Stripe package for laravel which was nothing but trouble for me.. I just couldn't get it working and now I decided to remove it completely.
So, I remove the line that requires this package in composer.json.
I removed the line from confing/app.php from the providers & aliases array. I also removed all references of that Cartalyst package from my code..
Somehow, after I run composer update I still get this error..
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Cartalyst\Stripe\Laravel\StripeServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with error code 1
What am I missing here?
You need to clear config cache. Run php artisan config:clear command to fix this.
If you still see the error message when you run the artisan commands, clear the bootstrap/cache directory manually.

is laravel 5.4 running migrations from vendor folders now?

I have installed some packages that have migrations in their vendor folders, previously one of the packages I used published these migrations to migrations folder by running:
php artisan vendor:publish
Now I found alteast 2 packages that no longer published migrations when running this command, so I went into vendor folder and grabbed migration file and manually moved it and when I run
composer dump-autoload I got a warrning message from it that said: Warning:
Ambiguous class resolution, "CreateRevisionsTable" was found in both "$baseDir . '/database/migrations/2013_04_09_062329_create_revisions_table.php" and "C:\xampp\htdocs\example\vendor/venturecraft/revisionable/src/migrations\2013_04_09_062329_create_revisions_table.php", the first will be used.
why is this happening? Has something changed in 5.4?
Yes, since version 5.4 Laravel supports loading migrations from any directory.
$this->loadMigrationsFrom(__DIR__.'/path/to/migrations');
Which could be used by a service provider of any package.

Resources