Laravel 5 - vendor:publish does not overwrite old files - laravel-5

Hi I have a problem where Laravel 5's vendor:publish command does not override old package assets. Does anyone know if this is the correct behaviour or do I have to somehow delete the old previous version before I can publish?
regards

Try using the --force flag.
$ php artisan vendor:publish --force

Related

Php artisan serve in laravel

I am new in laravel development. I am using latest version 9 of laravel, when I write php artisan serve in git bash or in VS code terminal after sometime it gives an error. I attached a screenshot of an error.
run php artisan optimize command
composer install
composer update
php artisan optimize:clear
This will clear all the cache of the application

How to run changes in the laravel projects in git

I'm new in git.
I'm modifying my Laravel project in my project's git folder.
but when I do php artisan serve, changes not work and previous codes run!
I have found the problem and solved it by :
php artisan route:clear
The routes got cached

laravel telescope nothing to migrate

i have a laravel 6 app that i want to install the telescope in that i did all the commands like composer update and composer dump-autoload and then i install the telescope every thing is going fine and when i run php artisan telescope:install i get the message below :
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.
but it wont generate the config file and migration so when i run php artisan migrate i get this message :
nothing to migrate
in your command
php artisan vendor:publish --tag=telescope-migrations
then edit you your env file
TELESCOPE_ENABLED=true
after this run
php artisan optimize
Finally
php artisan migrate
You must publish it first using the below command:
php artisan vendor:publish --tag=telescope-migrations
Then you will get the default migrations and also the config/telescope.php file
After installing the telescope in my project and exporting the default migration I got this error.
λ php artisan vendor:publish --tag=telescope-migrations
Unable to locate publishable resources.
Publishing complete.
How I solve this issue
If you're getting this issue open telescope.php file which is inside of your config directory.
and then set the value of this TELESCOPE_ENABLED to true
'enabled' => env('TELESCOPE_ENABLED', true),
Because in my case the value of TELESCOPE_ENABLED this was false
Then again run this command php artisan vendor:publish --tag=telescope-migrations.
I hope it will work :)
I had accidentally ran php artisan optimize in my local environment which was causing this issue. To fix it, I had to run php artisan optimize:clear, then uninstall laravel/telescope, remove any references to it, and install it again from scratch. It then recognised the migrations and the published assets.
I did this
composer remove laravel/telescope
Then change your .env file
TELESCOPE_ENABLED=true
Then install back again it worked!

Moving laravel project to another directory

I just installed laravel. I use Windows Xampp.
Currently I installed it in c:\users\user_name\laravel.
Is that correct or should I put it in htdocs?
If so how to do it?
thanks for your help
Cut paste you laravel project in path to xampp\htdocs . set root folder of xampp to xampp\htdocs\laravel\public
Thanks to syam who helped me to start finding a fix to my problem.
Here is my solution
Move laravel project to htdocs
Change the env configuration DB_DATABASE=your_db_name DB_USERNAME=user_name DB_PASSWORD=user_password
Edit AppServiceProvider.php and add this code
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Then in command line move the active directory to your laravel project and execute this code
composer install
php artisan key:generate
php artisan cache:clear
php artisan migrate
On moving laravel project to another directory:
To clear cache, sometimes permission problem may occur. Do this serially:
change env values then,
php artisan key:generate
php artisan config:clear
php artisan cache:clear
php artisan migrate

Laravel 5.4 RuntimeException] Directory name must not be empty

I'm just learning Laravel 5 and I am loving it.
I have an issue though, my php artisan command just stopped working all of a sudden. It shows this error
[RuntimeException]
Directory name must not be empty.
I am running on a windows10 pc . Thanks
Today I got the same issue while working on local environment, I really don't know how but my config folder was deleted automatically. Fortunately, I had backup with me and I simply re-add the config folder into my project and my site is back.
I think you need to update your composer like:
composer update
OR
composer update --no-scripts
after you can clear the cache
php artisan config:cache
php artisan config:clear
php artisan cache:clear

Resources