PHP code example of laravel-appkit / lockable

1. Go to this page and download the library: Download laravel-appkit/lockable 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/ */

    

laravel-appkit / lockable example snippets


$article->acquireLock();

$article->releaseLock();
 php


namespace App\Models;

use AppKit\Lockable\Traits\Lockable;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use Lockable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'title',
        'body'
    ];
}