'How to run laravel artisan command on server?

How to run laravel artisan command on server? I have to run this this command:

composer require realrashid/sweet-alert


Solution 1:[1]

If you have access for ssh, login through it.

Check if you have composer by typing composer in terminal else install it.

to Install composer use composer install command in terminal.

go to the root folder in which laravel is installed using cd command.

In the root folder, run the command php artisan in terminal.

It should work fine now.

What if you have Shared hosting?

Just look for terminal in cpanel. See image for ref..

enter image description here

Open it and try for the steps given above.

Thank you!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1