deegitalbe/laravel-trustup-io-model-commons

Common functionalities for our models

v1.1.2 2023-02-12 12:28 UTC

This package is auto-updated.

Last update: 2024-12-12 16:53:50 UTC


README

Overview

This package handle uuids & softdeletes for your models.

Installation

composer require deegitalbe/laravel-trustup-io-model-commons

Configuration

Add fields to your migrations

    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Support\Facades\Schema;

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('my-models', function (Blueprint $table) {
            $table->uuid();
            $table->softDeletes();
        });
    }

Your models should look like this

use Deegitalbe\LaravelTrustupIoModelCommons\Models\AbstractModel;

class MyModel extends AbstractModel
{
    // ...
}

You're good to go!