Skip to content

rashed-kaysar-rasel/laravel_sanctum

Repository files navigation

API Boilerplate with Laravel Sanctum

Getting Started

First clone the project and change the directory

git clone https://github.com/Rasel15827/laravel_sanctum.git

Then follow the process

Setup the project

  1. install the dependencies
composer install
  1. Copy .env.example to .env
cp .env.example .env
  1. Generate application key
php artisan key:generate
  1. Start the webserver
php artisan serve

That's mostly it! You have a fully running laravel installation with Sanctum, all configured.

Database Migration and Seeding

You can start with Mysql by following these steps

  1. Create a new Mysql database

  2. Open your .env file and change the DATABASE options.

  3. Open config\database.php and change the mysql options.

  4. You can run both migrations and seeders together by simply running the following command

php artisan migrate:fresh --seed

OR

you can run them separately using the following commands

  1. Run Migrations
php artisan migrate:fresh

Now your database has essential tables for user, roles management and category.

  1. Run Database Seeders

Run db:seed, and you have your first admin user, reguler user, some category, some essential roles in the roles table, and the relationship correctly setup.

php artisan db:seed

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published