You can run artisan commands from a route/controller by using `Artisan::call('command', [parameters])`.
This is what I use to run the 'artisan migrate', 'artisan optimize', 'artisan config:cache', and 'artisan route:cache' commands on the server. (source...