Invoice & Clients sorting

This commit is contained in:
Peter Papp
2021-05-11 10:09:50 +02:00
parent 1ea8f2ce60
commit a6db642db7
16 changed files with 195 additions and 98 deletions
+7 -1
View File
@@ -3,6 +3,7 @@ namespace App\Models\Oasis;
use App\Models\User;
use Illuminate\Support\Str;
use Kyslik\ColumnSortable\Sortable;
use Laravel\Scout\Searchable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
@@ -14,7 +15,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
*/
class Client extends Model
{
use HasFactory, Searchable;
use HasFactory, Searchable, Sortable;
public $guarded = ['id'];
@@ -22,6 +23,11 @@ class Client extends Model
protected $keyType = 'string';
public $sortable = [
'created_at',
'name',
];
/**
* Format avatar to full url
*
+8 -2
View File
@@ -1,10 +1,10 @@
<?php
namespace App\Models\Oasis;
use Carbon\Carbon;
use App\Models\User;
use Illuminate\Support\Str;
use Laravel\Scout\Searchable;
use Kyslik\ColumnSortable\Sortable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
@@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
class Invoice extends Model
{
use HasFactory, Searchable;
use HasFactory, Searchable, Sortable;
protected $casts = [
'items' => 'array',
@@ -24,6 +24,12 @@ class Invoice extends Model
'id',
];
public $sortable = [
'invoice_number',
'created_at',
'total_net',
];
public $incrementing = false;
protected $keyType = 'string';