icekristal/laravel-drafts

v2.0.0 2024-03-07 08:27 UTC

This package is auto-updated.

Last update: 2024-11-07 09:54:01 UTC


README

install:

composer require icekristal/laravel-drafts

migration:

php artisan vendor:publish --provider="Icekristal\LaravelDraft\DraftServiceProvider" --tag="migrations"

config:

php artisan vendor:publish --provider="Icekristal\LaravelDraft\DraftServiceProvider" --tag="config"

Usage

set route:

        Route::group([
            'prefix' => 'drafts',
            'as' => 'drafts.',
        ], function () {
            Route::get('/list', [DraftsController::class, 'index']);
            Route::post('/store', [DraftsController::class, 'store']);
            Route::post('/{draft}/update', [DraftsController::class, 'update']);
            Route::delete('/{draft}/delete', [DraftsController::class, 'delete']);
        });

set Trait owner draft:

use DraftTrait;