How to run Laravel project without executing artisan serve

To start your laravel project, you need to execute php artisan serve on your shell. But if you want
to run your project without executing the command, you have to do the following:

1. Transfer Files and Folder

Copy all files and folders inside public folder and transfer it to your project root directory.

2. Change directory setting in index.php

Since we transferred the index file to root directory, we now need to change the path of autoload.php and app.php. Now, open index.php and change it.

require __DIR__.'./vendor/autoload.php';

$app = require_once __DIR__.'./bootstrap/app.php';

Congratulations! You’re done.

Open your browser and go to http://localhost/project/

IF error occurs

Like directory base. Open your .htaccess and add the code below.

RewriteBase /project_name/

If you need to update your composer

 composer update 

If you’re having errros, don’t hesitate to comment below

Leave a Reply

Your email address will not be published. Required fields are marked *