- Clone the repository:
https://github.com/developermithu/api-blog-laravel.git
- Change directory:
cd api-blog-laravel
- Install dependencies:
composer install
- Copy the
.env.example
file to.env
:
cp .env.example .env
- Generate the application key:
php artisan key:generate
- Update the database configuration in the
.env
file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=api-blog-laravel
DB_USERNAME=root
DB_PASSWORD=
- Migrate and seed the database:
php artisan migrate:fresh --seed
- Start the development server:
php artisan serve --host=localhost
we explicitly set the host to localhost
to avoid sanctum cors issues.
- Open the application in your web browser at
http://localhost:8000
.