kdion4891 / laravel-ajax-crud

Build Laravel 6 CRUD apps in record time!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Looking for more of an admin panel package?

Check out my latest package, Valiant:

https://github.com/kdion4891/valiant

A full featured Laravel 6 admin panel package!


Imgur

Laravel AJAX CRUD

LAC is a Laravel 6 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 6 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 kdion4891/laravel-ajax-crud

Publish the nav view, CSS, & JS files:

php artisan vendor:publish --tag=install

Integrate the auth scaffolding:

php artisan lac:auth

Quick Start

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

php artisan lac:make Vehicle

Update the LacFields in the new Vehicle model class:

public function fields()
{
    return [
        LacField::make('ID')
            ->tableColumn()->tableSearchable()->tableOrder('desc'),
    
        LacField::make('Brand')
            ->tableColumn()->tableSearchable()->tableSortable()
            ->input()->inputCreate()->inputEdit()
            ->rules(['required']),
    
        LacField::make('Color')
            ->tableColumn()->tableSearchable()->tableSortable()
            ->inputSelect(['Red', 'Green', 'Blue'])->inputCreate()->inputEdit(),
    
        LacField::make('Created At')
            ->tableColumn()->tableSearchable()->tableHidden(),
    
        LacField::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.

About

Build Laravel 6 CRUD apps in record time!

License:MIT License


Languages

Language:PHP 47.2%Language:HTML 42.8%Language:JavaScript 8.9%Language:CSS 1.1%