PHP code example of gurgentil / laravel-eloquent-sequencer
1. Go to this page and download the library: Download gurgentil/laravel-eloquent-sequencer 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/ */
gurgentil / laravel-eloquent-sequencer example snippets
php
use Gurgentil\LaravelEloquentSequencer\Traits\Sequenceable;
use Illuminate\Database\Eloquent\Model;
class Task extends Model
{
use Sequenceable;
protected $fillable = [
'position',
];
protected static $sequenceableKeys = [
'task_list_id',
];
public function taskList()
{
return $this->belongsTo(TaskList::class);
}
}
bash
php artisan sequence:populate \\App\\Task
bash
php artisan sequence:flush \\App\\Task
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.