<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Coderfunda.blogspot.com</title>
</head>
<body>
<?=
Laravel artisan command run in route
//Execute artisan command from route
Route::get('clear_cache', function () {
\Artisan::call('cache:clear');
dd("Cache is cleared");
});
Artisan command in route
use Illuminate\Support\Facades\Artisan;
Route::post('/user/{user}/mail', function ($user) {
$exitCode = Artisan::call('mail:send', [
'user' => $user, '--queue' => 'default'
]);
//
});
Laravel artisan command run in route
public function store(Request $request)
{
Artisan::call("php artisan infyom:scaffold {$request['name']} --fieldsFile=public/Product.json");
}
?>
</body>
</html>
0 comments:
Post a Comment
Thanks