Search
 
SCRIPT & CODE EXAMPLE
 

PHP

execute artisan command from route

Route::get('clear_cache', function () {

    Artisan::call('cache:clear');

    dd("Cache is cleared");

});
Comment

artisan commands in route

//Clear Cache facade value:
Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    return '<h1>Cache facade value cleared</h1>';
});

//Reoptimized class loader:
Route::get('/optimize', function() {
    $exitCode = Artisan::call('optimize');
    return '<h1>Reoptimized class loader</h1>';
});

//Route cache:
Route::get('/route-cache', function() {
    $exitCode = Artisan::call('route:cache');
    return '<h1>Routes cached</h1>';
});

//Clear Route cache:
Route::get('/route-clear', function() {
    $exitCode = Artisan::call('route:clear');
    return '<h1>Route cache cleared</h1>';
});

//Clear View cache:
Route::get('/view-clear', function() {
    $exitCode = Artisan::call('view:clear');
    return '<h1>View cache cleared</h1>';
});

//Clear Config cache:
Route::get('/config-cache', function() {
    $exitCode = Artisan::call('config:cache');
    return '<h1>Clear Config cleared</h1>';
});
Comment

artisan command in route

use IlluminateSupportFacadesArtisan;

Route::post('/user/{user}/mail', function ($user) {
    $exitCode = Artisan::call('mail:send', [
        'user' => $user, '--queue' => 'default'
    ]);

    //
});
Comment

laravel artisan command run in route

public function store(Request $request)
{
   Artisan::call("php artisan infyom:scaffold {$request['name']} --fieldsFile=public/Product.json");
}
Comment

PREVIOUS NEXT
Code Example
Php :: function() use() php clousure examples 
Php :: failed to delete data in mysqli using php 
Php :: Get and access to the order data properties (in an array of values): 
Php :: how to follow unfollow on buddypress ajax call 
Php :: PHP 7 - Fatal error: Call to undefined method PDF::FPDF() 
Php :: How to perform form inpot in laravel 8 and export database 
Php :: automatically create html page using php and mysql 
Php :: laravel short collection by keys based on array 
Php :: Downward half-Pyramid Pattern of Star 
Php :: codeingniter 3 not like 
Php :: how to store api response to avariable in phpp 
Php :: laravel eloquent where date today 
Php :: refresh database tables yii 1 
Php :: php getgmail name 
Php :: live search in ajax 
Php :: Multiple Formats with PHP DateTime::createFromFormat() 
Php :: collection methods laravel 
Php :: codeigniter base url automatic 
Php :: laravel model bind with route in model 
Php :: wordpress programmatically change slug of media attachment site:wordpress.stackexchange.com 
Php :: doctrine findby criteria 
Php :: how to grab shortcode from custom post type 
Php :: php simple server 
Php :: ERROR: The following modules depend on mpm_prefork and need to be disabled first: php7.2 
Java :: printing hello world in java 
Java :: make javafx open full screen 
Java :: how to select a random element from an array in java 
Java :: java how to print an array 
Java :: how to print to console in java 
Java :: java lerp 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =