#### Category : laravel-artisan

hi guys I need help for this case I can’t run laravel 5.7 on php8, when I do "php artisan serve" I got error: thrown in /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 838 PHP Fatal error: Uncaught ErrorException: Method ReflectionParameter::getClass() is deprecated in /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Container/Container.php:838 I have tried to update composer required php version form "^7.1.3" to "php": "^7.1.3|^8.0", ..

I need to create a number of files in a specific format. So I planned to create a generate command by extending GeneratorCommand. I want to create view files and view-config files in application root directory. The problem is, I did not find any official doc to do so. There are some article in the ..

I have installed laravel/ui from composer and since I am learning I tried to setup bootstrap with it so I installed bootstrap from npm and then ran php artisan ui bootstrap. I was able to set it up properly. I now want to remove the installed frontend scaffolding and I couldn’t find anywhere how to ..

I am new to Laravel and PHP in general. I want to install Laravel how it is presented in this video: https://www.youtube.com/watch?v=ImtZ5yENzgE Well, almost every step in this video ends up with errors which I try to fix with hints from Stackoverflow. Maybe this is because I use Windows, or because there are newer versions ..

I make a command to run routes from it. Like this one: php artisan command:call –csrf=GCivIRtxYzHACOqJr3sasdasdGBJhR7q5X65VLv51K7 –user_id=1 –method=POST –path=/firms/load –data='{"id":2213}’ In a command i make: Auth::loginUsingId($this->option(‘user_id’));$params = json_decode($this->option(‘data’), true); if (!is_array($params)) {$params = [];}$params[‘_token’] = $this->option(‘csrf’);$request = Request::create($this->option(‘path’),$this->option(‘method’), $params, [‘XSRF-TOKEN’ =>$this->option(‘csrf’)]); $request->headers->set(‘Authorization’,$this->option(‘csrf’)); $response = app()->handle($request)->getContent(); echo $response; But every .. Read more This is a completely fresh installation of Laravel (because i was hoping that would fix the issue), which now makes it version 8.40.00. And to run it, i go through sail, by doing: ./vendor/bin/sail up -d. Even though the initial .env file has database credentials which don’t work (sail:password), the database connection works after quickly .. Read more I am using this function to create a fresh database tables public function new_migration(){ if(App::environment(‘demo’)){ try { Artisan::call(‘cache:clear’); Artisan::call(‘route:clear’); Artisan::call(‘config:clear’); Artisan::call(‘view:clear’); Artisan::call(‘migrate:fresh’, [ ‘–seed’ => true, ]); echo ‘New migrations done!’; } catch (Exception$e) { Response::make($e->getMessage(), 500); } }else{ App::abort(404); } } Which throws this error IlluminateDatabaseQueryException SQLSTATE[42S02]: Base table or view not found: .. Read more [SOLVED] i new to Laravel and PHP. i tried to migrate my own migrations but i can’t. this my laravel and php information: my php info PHP 8.0.3 (cli) (built: Mar 4 2021 05:33:14) ( NTS ) Composer version 2.0.11 2021-02-24 Laravel 8.x mysql Server version: 10.5.9-MariaDB Arch Linux my OS info uname: Linux ali .. Read more I’m hosting a laravel page on aws elastic beanstalk. For queueing I’m using SQS. I want to execute nohup php artisan queue:work –daemon > /dev/null 2>&1 & on the server by writing it into my init.config file in the .ebextensions folder. Now this works once: After the code is deployed every message in the queue .. Read more hello am using this url http://127.0.0.1:8000/admin/login to access admin login but it gave error InvalidArgumentException Auth guard [admin] is not defined this is auth.php paste.ofcode.org/tYvKwb86vaQCMDt5Wnw9at web.php: Auth::routes(); Route::get(‘/home’, [AppHttpControllersHomeController::class, ‘index’])->name(‘home’); Route::group([‘prefix’=>’admin’], function() { Route::group([‘middleware’=>’guest:admin’], function() { Route::view(‘login’, ‘admin.login’)->name(‘admin.login’); Route::post(‘login’, [AppHttpControllersHomeController::class, ‘authecticate’])->name(‘admin.auth’); }); Route::group([‘middleware’=>’admin.auth’], function() { Route::view(‘dashboard’, ‘admin.home’)->name(‘home’); }); }); kernel.php: protected$routeMiddleware = [ ‘auth’ ..

I wished create model call the laravel artisan tinker. so I try execute php tinker .. but AppUser command was occurred error. I don’t know. what should I do? My development enviroment vagrant php 8.* laravel 8.* enter image description here enter image description here >>> $user = AppUser::create ([‘name’ => ‘rin’, ’email’ => ‘[email protected]’, .. Read more I have an artisan command, in which I am cleaning up some data which has gone bad. Before I actually delete the data, I want to do a dry run and show some of the implications that deleting that data may present. The essesnce of my command is: public function handle() { …$this->dryRun($modelsToDelete); // .. Read more I am using Laravel v8.x, while executing php artisan route:list in cli iam getting the following error, In Exception.php line 40: Cannot declare class PHPMailerPHPMailerException, because the name is already in use Don’t know how to resolve this, any suggestions would be of greater help thanks in advance. Sourc.. Read more PHP Warning: require(C:UsersKrUpAfreeCodeGram/vendor/autoload.php): Failed to open stream: No such file or directory in C:UsersKrUpAfreeCodeGramartisan on line 18 PHP Fatal error: Uncaught Error: Failed opening required ‘C:UsersKrUpAfreeCodeGram/vendor/autoload.php’ (include_path=’.;C:phppear’) in C:UsersKrUpAfreeCodeGramartisan:18 Stack trace: #0 {main} thrown in C:UsersKrUpAfreeCodeGramartisan on line 18 Sourc.. Read more I have a new laravel 8 installation which I have changed the index directory to the based_path() directory. That is the root folder of fresh laravel installation. Now whenever I run php artisan serve It says that the$_SERVER[‘DOCUMENT_ROOT’] is the same as laravel public_path. But when I use the default php -S 127.0.0.1:8000 I ..

Very newbie here. Apologize if i’m asking something stupid or obvious. I’m playing around with test in Laravel, and I want to test the same function with different users I’ve created. Is there a way to pass the id as an argument throw laravel console? I mean, writing something like: /** @test */ public function ..

I have a database with some table. I once ran a command to generate all my Laravel Models with artisan. Now, my tables slightly changed, and I’m wondering if there is a way to update the models. I added some function in my models, and I want to keep them, so I can’t just delete ..

When running php artisan serve I get the error message: $php artisan serve Starting Laravel development server: http://127.0.0.1:8000 sh: line 0: exec: : not found Starting Laravel development server: http://127.0.0.1:8001 sh: line 0: exec: : not found It will repeat trying to start on other ports but without success. My installation worked fine a .. Read more Laravel Artisan Schedulers configured in app/console/kernel.php are not Creating Mutex files, thus WithoutOverlapping never working. However I never get errors. Those files are supposed to be at storage/frameworks/ right? Due to overlaps of Artisan Commands, my data geting duplicated. Sample commands written in kernel.php :$schedule->command(‘clear:logFiles’)->everyMinute()->withoutOverlapping(); $schedule->command(‘validate:sslCommerzTransactions’)->withoutOverlapping()->everyTenMinutes();$schedule->command(‘send:queuedTelegramNotifications’)->withoutOverlapping()->everyMinute(); \$schedule->command(‘send:queuedRewardNotifications’)->withoutOverlapping()->everyMinute(); I also made a custom function ..

I have a table in my db named affilaite. But when i try to create a new table named as product it gives me an error php artisan make:migration create_product_table PHP Fatal error: Cannot declare class CreateAffiliateTable, because the name is already in use in /home/manak/Desktop/manu/Edolve/database/migrations/2021_03_09_063908_create_affiliate_table.php on line 7 SymfonyComponentErrorHandlerErrorFatalError Cannot declare class CreateAffiliateTable, because ..

Good afternoon, I am making a website on e-commerce. And it allows me to add products and everything. But when I want to see my product list in admin panel and main page, I get two errors. Error number one: Trying to get property ‘status’ of non-object (View: C:xampphtdocsAplicaciones Web Para I4.0Tecnologia ExpressresourcesviewsfrontEndindex.blade.php) Code where ..

I have some custom commands in my Laravel projet. I have some interactions with my database inside all commands. When I try to use a command in the console I always get a Operation timed out when the DB is involved but if I try to run it in a function it works fine. My ..