lutfi/laravel-boilerplate

A Laravel 10 boilerplate with Vue.js frontend and API endpoints for mobile development

v1.0.0 2024-12-03 14:38 UTC

This package is auto-updated.

Last update: 2025-05-31 00:35:30 UTC


README

A modern Laravel 10 boilerplate with Vue.js 3 frontend and API endpoints for mobile development.

Features

  • Laravel 10.x
  • Vue 3 with Composition API
  • Vue Router for SPA
  • Vuex for state management
  • TailwindCSS for styling
  • Laravel Sanctum for API authentication
  • Spatie Permission for roles and permissions
  • API endpoints ready for mobile apps
  • Modern authentication system
  • Responsive design with TailwindCSS
  • HeadlessUI and Heroicons integration

Requirements

  • PHP >= 8.1
  • Composer
  • Node.js >= 16
  • NPM or Yarn

Installation

  1. Create a new project:
composer create-project lutfi/laravel-boilerplate your-project-name
  1. Navigate to your project:
cd your-project-name
  1. Install PHP dependencies:
composer install
  1. Install NPM dependencies:
npm install
  1. Copy the environment file:
cp .env.example .env
  1. Generate application key:
php artisan key:generate
  1. Configure your database in .env

  2. Run migrations:

php artisan migrate
  1. Build frontend assets:
npm run build

Development

  1. Start the Laravel development server:
php artisan serve
  1. Start the Vite development server:
npm run dev

API Endpoints

Authentication

  • POST /api/v1/register - Register a new user
  • POST /api/v1/login - Login user
  • POST /api/v1/logout - Logout user
  • GET /api/v1/user - Get authenticated user

Protected Routes

All protected routes require the Authorization: Bearer {token} header.

Frontend Structure

resources/js/
├── App.vue              # Main app component
├── app.js              # Application entry point
├── router/             # Vue Router configuration
├── store/              # Vuex store modules
├── components/         # Reusable components
└── views/              # Page components

Contributing

Feel free to submit pull requests or create issues for bugs and feature requests.

License

This project is open-sourced software licensed under the MIT license.