#### Category : laravel-artisan

So I am trying to use a laravel project that I already used before, these errors shows whenever I use any php artisan command: php artisan migrate PHP Warning: require(/var/www/html/orange/php/application/vendor/guzzlehttp/psr7/src/functions_include.php): failed to open stream: No such file or directory in /var/www/html/orange/php/application/vendor/composer/autoload_real.php on line 54 PHP Fatal error: require(): Failed opening required ‘/var/www/html/orange/php/application/vendor/guzzlehttp/psr7/src/functions_include.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/html/orange/php/application/vendor/composer/autoload_real.php ..

I’m trying to enter some non-ascii characters (Farsi/Arabic) into artisan console commands but $this->ask(‘Enter the description’) returns null if I use something like following as answer of ask in my terminal (which is PowerShell 7.1.4). Console command code:$answer = $this->ask(‘Enter the description’); echo$answer,"n", $answer===null ? ‘Null entered’ : ‘non null’; Terminal:$ php ..

I have a live PHP/Laravel project with multiple scheduled jobs, The customer asked for one of the jobs to be disabled, is there a way to disable ONE of the scheduled jobs through the command line? I, of course, can comment out the code in the consolekernel.php which registers the task but this is only ..

I have a live PHP/Laravel project with multiple scheduled jobs, The customer asked for one of the jobs to be disabled, is there a way to disable ONE of the scheduled jobs through the command line? I, of course, can comment out the code in the consolekernel.php which registers the task but this is only ..

I am working on projects where the CronJob works are being handelled by a console commands. Those commands are developed manually to serve different jobs on the DB. But now the issue is When we run php artisan cache:clear it checks all commands created under console folder first and then its running the cache:clear command. ..

Laravel has php artisan list command. It shows all available commands. I’ve created a bunch of custom commands in app/Console/Commands folder. I see them in a list of all commands. But is the a way to show ONLY my commands in that list? To hide Laravel built-in commands from that list? Sourc..

I want to create a criteria file in specified path, can you please help me.. Path:- App->ship->criteria->eloquent I am trying with php artisan make: criteria someName –path=AppshipcriteriaEloquent Sourc..

I want to create a criteria file in specified path, can you please help me.. Path:- App->ship->criteria->eloquent I am trying with php artisan make: criteria someName –path=AppshipcriteriaEloquent Sourc..

I have a table participant which has a many-to-one relationship with table campaign. Now for some stupid reason I forgot to add a column campaign_id, which holds the foreign key to the row in table campaign. Now to fix this I could easily add the following line to the create_participants_table migration file and run the ..

I have a music_upload table which references both album_id and user_id from both album and user table. The user_id foreign key works fine, it is the album_id foreign key which spews out this error SQLSTATE[HY000]: General error: 1005 Can’t create table nightingalev2.music_uploads (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table music_uploads add ..

I have below json object. { "sender": { "first_name": "test", "last_name": "sender" }, "beneficiary": { "first_name": "test", "last_name": "bnf" }, "transaction": { "code": "ABC", "amount": 100, "fee": 1 } } I want it to pass it as an option of the command. I tried to json_encode() it from where I am calling the artisan command ..

How to empty all queued jobs in a redis database for a given queue in Laravel versions previous to Laravel 8 ? Sometime when your queue is filling in a dev environment you want to clean all queued jobs to go back to a fresh start. Laravel doesn’t provide an easy way for doing so ..

I want to change my model name and it’s database table name in a laravel project, but I’ve connected to other models with relationships. Now I wanna know if is there any way or artisan command to change it so it do not make problems for it’s connection? Thank You. Sourc..

I have a Multi Tenancy web application. I have a new client creation form that is used to populate a new client in the landlord.tenants database and then create the required database with seeded tables. To achieve this I run the following commands from the Livewire Class(controller). //Create DataBase Artisan::call(‘db:create-tenant ‘.$this->database); //Create tables and seed. .. Read more when i run php artisan route:cache or php artisan optimize it’s return : Unable to prepare route [{fallbackPlaceholder}] for serialization. Uses Closure. at vendor/laravel/framework/src/Illuminate/Routing/Route.php:1150 1146| */ 1147| public function prepareForSerialization() 1148| { 1149| if ($this->action[‘uses’] instanceof Closure) { 1150| throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure."); 1151| } 1152| 1153|$this->compileRoute(); ..

I tried running other php artisan commands too but still not getting any response. Has anyone run into the same problem? Sourc..

I hope you’re alright, I just want to put this post because the down() function and drop column and all these things didn’t work for me as well. For example: public function down() { Schema::table(‘users’, function($table) {$table->dropColumn(array(‘description1’, ‘description2’, ‘description3’)); }); } From this post : Laravel migrate:rollback adding and deleting table columns. Sourc..

I am new in Laravel, what I try to achieve is very simple thing, I would like to use FormRequest provided by Laravel to do validation of the request, but I encounter some puzzles (which I am sure is easy things to solve if you are experienced in Laravel). Here is what I tried: I ..

everybody, I use Laravel installed in Lando and have an issue, I’m trying to create a column in a table in my DB, here is the code: Schema::table(‘users’, function (Blueprint $table) {$table->string(‘Blue’)->unique(); }); and this is what I have in my configdatabase.php ‘driver’ => ‘mysql’, ‘url’ => env(‘DATABASE_URL’), ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’), ‘port’ => ..

I’m creating a model using the command referenced in Laravel 8 documentation. The command is php artisan make:model Flight -mfsc but the command line keeps returning the same output. The "-s" option does not exist. Do you know why this is happening? Laravel 8 Composer version 2.1.9 2021-10-05 09:47:38 Sourc..

I’m following the official documentation for Laravel 5.7 on the events registration and generation: https://laravel.com/docs/5.7/events#generating-events-and-listeners I have an EventServiceProvider with the following events defined: /** * The event handler mappings for the application. * * @var array */ protected $listen = [ ‘AppEventsFormBeforeCreate’ => [ ‘AppListenersWebhookBeforeCreate’, ], ‘AppEventsFormAfterCreate’ => [ ‘AppListenersNotifyAfterCreate’, ‘AppListenersWebhookAfterCreate’, ], ‘AppEventsFormBeforeUpdate’ => .. Read more when i run php artisan key:generate in cmd it’s return file_get_contents(/project/positiv/core/vendor/psy//.env): failed to open stream: No such file or directory at /project/positiv/core/vendor/laravel/framework/src/Illuminate/Foundation/Console/KeyGenerateCommand.php:96 { file_put_contents($this->laravel->environmentFilePath(), preg_replace( $this->keyReplacementPattern(), ‘APP_KEY=’.$key, file_get_contents(\$this->laravel->environmentFilePath()) )); } I am trying to generate APP_KEY!!! Sourc..