PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 4, 2022

[FIXED] Error while running artisan command from controller

 March 04, 2022     laravel, laravel-5, laravel-backup, php     No comments   

Issue

while running below artisan command from controller works fine

Artisan::call('backup:run');

but why this is not working

Artisan::call('backup:run --only-db');

it throws error The command "backup:run --only-db" does not exist.

through CLI it works fine

php artisan backup:db --only-db

Solution

I believe what you wanted to do is.

Artisan::call('backup:run',['--only-db'=>true]);


Answered By - rapulu
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing