realsoft/lacruda

Build Laravel 7 CRUD apps in record time!


Keywords
ui, ajax, crud, table, generate, tables
License
MIT

Documentation

LAravel CRUD AJAX (LACRUDA) Docs

LACRUDA is a Laravel 7 package designed to integrate beautifully while saving you tons of time. Get a complete CRUD interface done in minutes by adding a few lines of code to your models.

Features include:

  • Full Laravel 7 auth & resource integration
  • Unobtrusive implementation to keep you in control
  • Field, action, & bulk action helper classes
  • Scaffolding command to create files for you
  • Intuitive, responsive UI design
  • AJAX validation & responses
  • Ease of use and customization

Links of interest:

Installation

Require the package:

composer require realsoft/lacruda

Publish the nav view, CSS, & JS files:

php artisan vendor:publish --tag=install

Integrate the auth scaffolding:

php artisan lacruda:auth

Quick Start

Make scaffolding files for a new model (a Vehicle, for example):

php artisan lacruda:make Vehicle

Update the LacrudaFields in the new Vehicle model class:

public function fields()
{
    return [
        LacrudaField::make('ID')
            ->tableColumn()->tableSearchable()->tableOrder('desc'),

        LacrudaField::make('Brand')
            ->tableColumn()->tableSearchable()->tableSortable()
            ->input()->inputCreate()->inputEdit()
            ->rules(['required']),

        LacrudaField::make('Color')
            ->tableColumn()->tableSearchable()->tableSortable()
            ->inputSelect(['Red', 'Green', 'Blue'])->inputCreate()->inputEdit(),

        LacrudaField::make('Created At')
            ->tableColumn()->tableSearchable()->tableHidden(),

        LacrudaField::make('Updated At')
            ->detailsHidden(),
    ];
}

Update the new *_create_vehicles_table migration file with your field columns:

Schema::create('vehicles', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->string('brand');
    $table->string('color')->nullable();
    $table->timestamps();
});

Run the migration:

php artisan migrate

Log into your app with any auth User and click the Vehicles link in the navbar to view the CRUD.

Learn more in the docs.