Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i run artisan commands in cpanel

How can i run these artisan commands in my application that is hosted in the net? Is there like a cmd in my cpanel where i can do these commands? Thanks in advance.

  • php artisan clear:cache
  • php artisan view:clear
like image 904
Ronald Torres Avatar asked Dec 08 '17 09:12

Ronald Torres


People also ask

How do I run Artisan command in cPanel?

Actually in Cpanel no commands for php and composer related run because everytime you upload your projects on Cpanel you have to compile it down in your local and then upload it. Alternatively, get the SSH access from your Cpanel and after successful SSH login try running your various artisan commands you want.


1 Answers

Now in Laravel 5.8, you cannot pass object to call() func. You must pass an array [] as second argument to call() func.

Route::get('/clear-cache', function() {
    $output = [];
    \Artisan::call('cache:clear', $output);
    dd($output);
});
like image 58
Mudassar Avatar answered Oct 21 '22 03:10

Mudassar