hardimpactdev/craft-laravel

This is my package laravel

Fund package maintenance!
Liftoff

Installs: 114

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 4

pkg:composer/hardimpactdev/craft-laravel

0.2.0 2026-01-19 08:10 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Companion scaffolding package for craft-starterkit. Provides commands to rapidly set up authentication, dashboard, settings, CMS (Filament), and multi-language support.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Requirements

  • PHP 8.1 or higher
  • Laravel 10.x, 11.x, or 12.x
  • Node.js and npm/bun for frontend assets

AI-Assisted Development

This package includes Laravel Boost integration. When you have both packages installed, AI assistants will automatically understand the available scaffolding commands.

composer require laravel/boost --dev
php artisan boost:install

Installation

You can install the package via composer:

composer require hardimpactdev/craft-laravel

Scaffolders

The package provides powerful scaffolding commands to quickly set up different aspects of your application. All scaffolders automatically generate routes using the waymaker package.

Available Scaffolders

1. App Scaffolder (Full Application Setup)

The most comprehensive scaffolder that sets up a complete application with authentication and dashboard.

php artisan craft:setup app

This scaffolder includes:

  • ✅ App class with redirect configuration
  • ✅ Dashboard controller and views
  • ✅ Settings pages (profile, password, appearance)
  • ✅ HandleInertiaRequests middleware
  • ✅ TypeScript type definitions
  • ✅ Feature tests
  • ✅ Full authentication system (runs Auth scaffolder)
  • ✅ Automatic route generation

Note: For CMS functionality, use php artisan craft:setup cms instead.

2. Auth Scaffolder

Sets up a complete authentication system with login, registration, password reset, and email verification.

php artisan craft:setup auth

This scaffolder includes:

  • ✅ Authentication controllers with route attributes
  • ✅ Login request validation
  • ✅ Vue.js authentication pages
  • ✅ Authentication tests
  • ✅ User migration publishing

Note: The auth scaffolder requires the App class to be present. If running standalone, ensure you have an App class or run the app scaffolder instead.

3. Dashboard Scaffolder

Sets up dashboard and settings pages. Requires authentication to be set up first.

php artisan craft:setup dashboard

This scaffolder includes:

  • ✅ App class with redirect configuration
  • ✅ Dashboard controller and views
  • ✅ Settings pages (profile, password, appearance)
  • ✅ HandleInertiaRequests middleware
  • ✅ TypeScript type definitions
  • ✅ Feature tests
  • ✅ Automatic route generation

Note: Run php artisan craft:setup auth first, or use php artisan craft:setup app which includes both.

4. CMS Scaffolder

Sets up Filament CMS with user management and authentication.

php artisan craft:setup cms

This scaffolder includes:

  • ✅ App class with redirect configuration
  • ✅ Full authentication system (runs Auth scaffolder)
  • ✅ Filament package installation
  • ✅ User resource for managing users
  • ✅ Admin panel configuration
  • ✅ Filament CSS build process
  • ✅ Automatic route generation

5. Multilanguage Scaffolder

Sets up multi-language/i18n support with translation files.

php artisan craft:setup multilanguage

This scaffolder includes:

  • ✅ Language translation files
  • ✅ Example translation component
  • ✅ Automatic route generation

Route Generation

All scaffolders use the waymaker package to automatically generate routes from controller attributes. Routes are generated at the end of each scaffolding process, eliminating the need to manually run php artisan waymaker:generate.

Files and Directories Created

App Scaffolder creates:

app/
├── App.php
├── Http/
│   ├── Controllers/
│   │   ├── DashboardController.php
│   │   └── Settings/
│   │       ├── AppearanceController.php
│   │       ├── PasswordController.php
│   │       └── ProfileController.php
│   ├── Middleware/
│   │   └── HandleInertiaRequests.php
│   └── Requests/
│       └── Settings/
│           └── ProfileUpdateRequest.php
resources/js/
├── pages/
│   ├── Dashboard.vue
│   └── settings/
│       ├── Appearance.vue
│       ├── Password.vue
│       └── Profile.vue
└── types/
    └── index.d.ts
tests/Feature/
├── DashboardTest.php
└── Settings/
    ├── PasswordUpdateTest.php
    └── ProfileUpdateTest.php

Auth Scaffolder creates:

app/Http/
├── Controllers/Auth/
│   ├── ConfirmablePasswordController.php
│   ├── EmailVerificationNotificationController.php
│   ├── EmailVerificationPromptController.php
│   ├── ForgotPasswordController.php
│   ├── LoginController.php
│   ├── NewPasswordController.php
│   ├── RegisterController.php
│   └── VerifyEmailController.php
└── Requests/Auth/
    └── LoginRequest.php
resources/js/
├── layouts/auth/
│   └── AuthLayout.vue
└── pages/auth/
    ├── ConfirmPassword.vue
    ├── ForgotPassword.vue
    ├── Login.vue
    ├── Register.vue
    ├── ResetPassword.vue
    └── VerifyEmail.vue
tests/Feature/Auth/
├── AuthenticationTest.php
├── EmailVerificationTest.php
├── PasswordConfirmationTest.php
├── PasswordResetTest.php
└── RegistrationTest.php

Usage Examples

Quick Start - Full Application

# Install the package
composer require hardimpactdev/craft-laravel

# Run the app scaffolder for a complete setup
php artisan craft:setup app

# Install frontend dependencies
npm install # or bun install

# Run migrations
php artisan migrate

# Start development server
npm run dev # or bun dev

Authentication Only

# Run just the auth scaffolder
php artisan craft:setup auth

# Note: Requires App class to be present

CMS with Authentication

# Run the CMS scaffolder (includes auth)
php artisan craft:setup cms

# Install frontend dependencies
npm install # or bun install

# Run migrations
php artisan migrate

# Create a Filament admin user (required to access /admin)
php artisan make:filament-user

Important Notes

  1. Middleware Replacement: The HandleInertiaRequests middleware will be replaced if it already exists in your application.

  2. Route Attributes: All controllers use route attributes from the waymaker package, eliminating the need for manual route definitions.

  3. App Class: The App class provides a centralized location for application configuration, including login redirect routes.

  4. File Merging: When copying directories, existing files are preserved unless they have the same name as files being copied.

  5. Dependencies: Make sure to install the waymaker package if not already installed:

    composer require nckrtl/waymaker

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.