Laravel provides a convenient facade for the teams of craftsmen.
Just use Artisan::call('your-command')
where you need it.
Example:
Route::get('artisan-command/{command}', function($command) {
Artisan::call($command);
});
Your url is as follows: http://yourhost.com/artisan-command/db:seed
More specific for your use case:
Route::get('vendor-publish/{provider}', function($provider) {
Artisan::call('vendor:publish', ['provider' => $provider]);
});
And URL: http://yourhost.com/vendor-publish/Tymon\JWTAuth\Providers\JWTAuthServiceProvider
Link: Artisan Console in Laravel Docs
source
share