marekmiklusek/laraboost

A package that automatically apply common Laravel configurations, development tools and more...

v1.0.3 2025-06-02 13:16 UTC

This package is auto-updated.

Last update: 2025-06-08 16:01:05 UTC


README

logo form my laravel package called_ laraboost(1)

Latest Stable Version Downloads License

๐Ÿš€ Quick Application Bootstrapping

Tired of adding the same configuration code to every new Laravel project? This package automatically applies best practice configurations and installs essential development tools with a single command.

โœจ Features

  • ๐Ÿ”„ Automatically applies common Laravel configurations
  • ๐Ÿงฐ Installs essential dev tools (Debugbar, Larastan, Rector)
  • ๐Ÿ“ Creates pre-configured tool settings files
  • ๐Ÿ› ๏ธ Provides helpful artisan commands
  • โšก Optimizes DB access with destructive command protection
  • ๐Ÿ“… Configures Carbon for immutable dates
  • ๐Ÿ” Sets up strict model usage with automatic eager loading
  • ๐ŸŒ Enforces HTTPS in production
  • ๐Ÿš€ Configures Vite with aggressive prefetching

๐Ÿ“‹ Requirements

  • PHP 8.3+
  • Laravel 12+

๐Ÿ“ฆ Installation

composer require marekmiklusek/laraboost

๐Ÿ”ง Usage

Automatic Configuration

Once installed, the package will automatically apply all configurations:

  • DB destructive command protection in production
  • Carbon immutable dates
  • Strict model usage with automatic eager loading
  • HTTPS enforcement in production
  • Vite with aggressive prefetching

Installing Development Tools

Run the following command to install development tools:

php artisan install:dev-tools

This command will install the following packages via Composer:

  • Laravel Debugbar
  • Larastan (PHPStan for Laravel)
  • Rector (PHP refactoring tool)

It will also create the following configuration files in your project root:

  • pint.json - Laravel Pint configuration
  • phpstan.neon - Larastan configuration
  • rector.php - Rector configuration

Creating Action Classes

Generate new action classes using the provided Artisan command:

php artisan make:action CreateTodoAction

This will create a new action class with the following structure:

<?php

declare(strict_types=1);

namespace App\Actions;

use Illuminate\Support\Facades\DB;

final readonly class CreateTodoAction
{
    /**
     * Execute the action.
     */
    public function execute(): void
    {
        DB::transaction(function (): void {
            //
        });
    }
}

๐Ÿ’ป Configuration Details

Applied Configurations

// Database commands
DB::prohibitDestructiveCommands(app()->isProduction());

// Date handling
Date::use(CarbonImmutable::class);

// Model configurations
Model::automaticallyEagerLoadRelationships();
Model::unguard();
Model::shouldBeStrict();

// URL handling
URL::forceHttps(app()->isProduction());

// Vite configuration
Vite::useAggressivePrefetching();

๐Ÿงช Development Tools

Laravel Debugbar

A package that adds a debugging bar at the bottom of your pages during development, providing valuable information about queries, views, routes, and more.

Larastan

A PHPStan wrapper for Laravel that provides static analysis for your Laravel application code.

Rector

A tool for automated refactoring and upgrades of your PHP code.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

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