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 ..

Read more

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 ..

Read more

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 ..

Read more

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(); ..

Read more

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..

Read more

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’ => ..

Read more

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..

Read more

After lunching the command php artisan optimize , i got fatal error: Uncaught ReflectionException: Class "env" does not exist I have tried deleting the bootstrap/cache/ and runing composer update but nothing works, everytime i tried to run a php artisan command/composer command i got the same problem. am really stuck. any help. Sourc..

Read more