Set TwoFAccount model to be sortable

This commit is contained in:
Bubka 2020-03-25 21:58:05 +01:00
parent c6a6b97fbd
commit 2295613263

View File

@ -4,12 +4,18 @@ namespace App;
use OTPHP\HOTP; use OTPHP\HOTP;
use OTPHP\Factory; use OTPHP\Factory;
use Spatie\EloquentSortable\Sortable;
use Spatie\EloquentSortable\SortableTrait;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Contracts\Encryption\DecryptException; use Illuminate\Contracts\Encryption\DecryptException;
class TwoFAccount extends Model class TwoFAccount extends Model implements Sortable
{ {
use SortableTrait;
/** /**
* model's array form. * model's array form.
* *
@ -49,6 +55,17 @@ class TwoFAccount extends Model
} }
/**
* Sortable settings
*
* @var array
*/
public $sortable = [
'order_column_name' => 'order_column',
'sort_when_creating' => true,
];
/** /**
* Null empty icon resource has gone * Null empty icon resource has gone
* *