PHP code example of icekristal / laravel-drafts

1. Go to this page and download the library: Download icekristal/laravel-drafts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

icekristal / laravel-drafts example snippets


composer 

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

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

        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']);
        });

use DraftTrait;