I have faced a problem when I am run the command from my code, My code is fine, I have test the code, Because when I run this Artisan::call('view:clear');
then its working, But when I run this Artisan::call('backup:run');
Browser told me: The command "backup:run" does not exist.
Note: when I am run this php artisan backup:run
using cmd then it's working, I will be grateful, If you guys help me, Thank you
Here is my All code of controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
class BackupController extends Controller
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function __invoke(Request $request)
{
try {
Artisan::call('backup:run');
return 'Done';
} catch (\Exception $e) {
return $e->getMessage();
}
}
}