Laravel Restify Starter Kit

Complete installation guide for your Laravel API project

Ready to use starter kit

This starter kit includes authentication, user management, teams, roles & permissions, and invitations system out of the box.

Requirements

PHP ^8.2
Laravel ^12.0
Composer 2.x
MySQL/PostgreSQL/SQLite

Installation Steps

1 Install Dependencies

Install PHP dependencies using Composer:

composer install

2 Environment Setup

Copy the example environment file and generate an application key:

cp .env.example .env
php artisan key:generate

3 Configure Database

Update your .env file with your database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_username
DB_PASSWORD=your_password

4 Run Migrations

Create the database tables:

php artisan migrate

5 Seed Initial Data (Optional)

Optionally, seed the database with sample data:

php artisan db:seed

6 Start the Development Server

You can now start the Laravel development server using either command:

composer dev # Recommended - runs php artisan serve
php artisan serve

Your API will be available at http://127.0.0.1:8000

Available API Endpoints

After installation, the following endpoints will be available:

Authentication

POST /api/register
POST /api/login
POST /api/forgotPassword
POST /api/resetPassword
GET /api/v1/profile
PUT /api/v1/profile

User Management

GET /api/v1/users
POST /api/v1/users
GET /api/v1/users/{id}
PATCH /api/v1/users/{id}
DELETE /api/v1/users/{id}
POST /api/v1/users/{id}/sync/roles

Roles & Permissions

GET /api/v1/roles
GET /api/v1/roles/{id}
POST /api/v1/roles
GET /api/v1/permissions
POST /api/v1/roles/{id}/sync/permissions

Teams Management

GET /api/v1/teams
POST /api/v1/teams
GET /api/v1/teams/{id}
DELETE /api/v1/teams/{id}
POST /api/v1/teams/bulk
GET /api/v1/teams/{id}/users
POST /api/v1/teams/{id}/attach/users
POST /api/v1/teams/{id}/detach/users
POST /api/v1/teams/{id}/sync/users

Invitations

GET /api/v1/invitations
POST /api/v1/invitations
POST /api/v1/invitations/{id}/actions?action=resend-invitation-email
POST /api/v1/invitations/confirm

Postman Collection

The starter kit includes a complete Postman collection with all API endpoints pre-configured. You'll find it in the storage/postman folder.

Using with Laravel Valet or Herd

If you're using Laravel Valet or Laravel Herd, you can easily configure the Postman collection:

  1. Import the collection and environment files from storage/postman
  2. Go to Postman Environments
  3. Edit the api variable
  4. Replace it with your folder name (e.g., http://laravel-restify-starter-kit.test/api)

Default Configuration

By default, the Postman environment is configured for http://127.0.0.1:8000/api

Project Structure

This is a standard Laravel application with minimal modifications. The main addition is the app/Restify folder where all Laravel Restify repositories are located.

Key Directories

app/
├── Restify/                    # Laravel Restify repositories
│   ├── Users/
│   │   ├── UserRepository.php  # User model wrapper
│   │   └── Actions/           # Custom user actions
│   ├── TeamRepository.php      # Team model wrapper
│   ├── Permissions/
│   │   ├── PermissionRepository.php
│   │   ├── RoleRepository.php
│   │   └── Actions/           # Permission-related actions
│   └── Invitations/
│       ├── InvitationRepository.php
│       ├── Actions/           # Invitation actions
│       └── Controllers/       # Custom controllers
├── Models/                     # Standard Laravel models
├── Http/Controllers/           # Standard Laravel controllers
├── Policies/                   # Laravel policies
└── Providers/                  # Service providers

Repositories

Model wrappers that define how your models are exposed via the API. Each repository corresponds to a model.

Learn more →

Actions

Custom actions that can be performed on resources. Located in Actions folders within each repository.

Learn more →

Fields

Each repository defines fields that represent model attributes and control data display/validation.

Learn more →

Getting Started with Development

  1. Explore existing repositories: Start by opening app/Restify/Users/UserRepository.php to see how fields are defined
  2. Add new fields: Each field typically represents a model attribute
  3. Create custom actions: Add new actions in the Actions folder when you need custom endpoints
  4. Standard Laravel: Everything else follows standard Laravel conventions - models, migrations, controllers, etc.

Next Steps

Need help? Check out the full documentation or reach out to our community.