jdion84/lucid is a Laravel package for declare database schemas inside laravel models..
It currently has 0 GitHub stars and 6 downloads on Packagist (latest version 1.0.0).
Install it with composer require jdion84/lucid.
Discover more Laravel packages by jdion84
or browse all Laravel packages to compare alternatives.
Last updated
Declare database schemas inside Laravel models.
Require this package via composer:
composer require jdion84/lucid
Create a new model class with a schema method:
php artisan make:schema Post
Or, add a schema method to an existing model:
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Jdion84\Lucid\Table;
class Post extends Model
{
use HasFactory;
public function schema(Table $table)
{
$table->id();
$table->string('title')->index();
$table->text('body');
$table->timestamp('created_at');
$table->timestamp('updated_at');
}
}
Migrate & sync model schema methods with the database:
php artisan migrate:schemas
Create a new model class with a schema method:
php artisan make:schema {name} {--p|pivot} {--force}
Migrate & sync model schema methods with the database:
migrate:schemas {--f|fresh} {--s|seed} {--force}