jjarroyo/laravel-kit

Un kit de herramientas para agilizar el desarrollo en Laravel.

v1.0.0 2025-06-11 22:51 UTC

This package is auto-updated.

Last update: 2025-06-11 22:53:46 UTC


README

Latest Version on Packagist Total Downloads License: MIT

Laravel Kit is a powerful set of Artisan commands to enhance your Laravel development workflow, automate repetitive tasks, and enforce best practices.

๐Ÿงญ Table of Contents

๐Ÿ“ฆ Installation

Install via Composer:

composer require jjarroyo/laravel-kit

๐Ÿ“˜ Available Commands

1. kit:make-pro-crud

Professional Livewire-based CRUD generator. Analyzes existing migration files to create smart components.

php artisan kit:make-pro-crud {model} {--m|model} {--soft-deletes} {--prefix=}

๐Ÿ”น Arguments

Argument Description
model Resource name in Plural PascalCase (e.g., Products, BlogPosts)

๐Ÿ”ธ Options

Option Description
--m, --model Generates the model and migration if not present
--soft-deletes Adds Soft Delete support
--prefix= Adds a route prefix (e.g., /admin/products)

๐Ÿš€ This command generates:

  • Eloquent model with fillable, casts, and inferred relationships
  • Livewire components: List, Create, and Edit
  • Blade views with a modern UI (dark mode, cards, modals)
  • Language files (lang/en and lang/es)
  • Protected routes using auth middleware

2. kit:init

Bootstraps a Laravel project with a professional package stack.

php artisan kit:init

๐Ÿ”ง Includes packages:

  • spatie/laravel-permission
  • laravel-lang/lang
  • laravel/telescope
  • spatie/laravel-activitylog
  • spatie/laravel-medialibrary
  • spatie/laravel-backup

The command is interactive and asks for confirmation before installing each package.

3. kit:translate-view

Refactors Blade views by extracting hardcoded strings into language files.

php artisan kit:translate-view {path} {--lang=es} {--group=}

๐Ÿ”น Arguments

Argument Description
path View path or directory (dot notation)

๐Ÿ”ธ Options

Option Description
--lang= Target language code (default: es)
--group= Custom language file group name

๐Ÿงช Examples

# Translate dashboard.blade.php โ†’ lang/es/dashboard.php
php artisan kit:translate-view dashboard

# Translate all views in the settings directory โ†’ lang/es/settings.php
php artisan kit:translate-view settings

# Translate settings views โ†’ lang/en/general.php
php artisan kit:translate-view settings --lang=en --group=general

4. kit:make-crud

Lightweight CRUD generator for quick scaffolding.

php artisan kit:make-crud {name} {--m|model} {--soft-deletes}

โœ… Generates:

  • Empty Livewire components: List, Create, Edit
  • Basic Blade views

๐Ÿงช Usage Example

# (Optional) Create a model and migration
php artisan make:model Post -m

# Define your schema in the migration...

# Run the professional CRUD generator
php artisan kit:make-pro-crud Posts --m --soft-deletes

# Confirm when prompted to run migrations

๐Ÿค Contributing

Contributions are welcome! Feel free to submit a pull request with improvements or new features.

๐Ÿ“„ License

Laravel Kit is open-source software licensed under the MIT license.