Hydra is a zero-config API boilerplate with Laravel 9x + Laravel Sanctum that comes with an excellent user and role management API out of the box
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Hasin Hayder c670d6a2fe
Inverse of Relationship - Role belongs to many User
4 years ago
app Inverse of Relationship - Role belongs to many User 4 years ago
bootstrap Laravel Foundation 4 years ago
config Functional User Registration and Login with Roles and Abilities With Default Values from the Options table 4 years ago
database User Seeder Updated 4 years ago
lang/en Laravel Foundation 4 years ago
public Laravel Foundation 4 years ago
resources Cleanup SPA Code - That will be a separate project 4 years ago
routes Hydra Controller 4 years ago
storage Laravel Foundation 4 years ago
tests Laravel Foundation 4 years ago
.editorconfig Laravel Foundation 4 years ago
.env.example Example .env With SANCTUM_STATEFUL_DOMAINS. Added localhost:8000 to the list 4 years ago
.gitattributes Laravel Foundation 4 years ago
.gitignore Functional User Registration and Login with Roles and Abilities With Default Values from the Options table 4 years ago
.styleci.yml Laravel Foundation 4 years ago
README.md Readme 4 years ago
artisan Laravel Foundation 4 years ago
composer.json Laravel Foundation 4 years ago
composer.lock Laravel Foundation 4 years ago
package.json Laravel Foundation 4 years ago
phpunit.xml Laravel Foundation 4 years ago
webpack.mix.js Laravel Foundation 4 years ago

README.md

Hydra

Zero config API Boilerplate with roles and abilities for Laravel Sanctum

Getting Started

It's super easy to get Hydra up and running.

  1. clone the project
git clone https://github.com/hasinhayder/hydra.git
  1. Copy .env.example to .env
cp .env.example .env

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

Database Migration and Seeding

Open your .env file and change the DATABASE options. You can start with SQLite by following these steps

  1. Create a new sqlite database
touch database/hydra.sqlite

Or simply create a new file as hydra.sqlite inside your database folder.

  1. Run migration
php artisan migrate

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

  1. Database Seeding

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

php artisan db:seed

Please note that the default admin user is admin@hydra.project and default password is hydra. You should create a new admin user before deploying to production and delete this default admin user. You can do that using available Hydra user management API, or using any DB management tool.