upgraded to laravel 10
This commit is contained in:
@ -37,7 +37,8 @@ class User extends Authenticatable implements HasLocalePreference
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
'enabled' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -195,7 +196,7 @@ class User extends Authenticatable implements HasLocalePreference
|
||||
/**
|
||||
* Modules that use the sort parameter in CRUD operations cause an error,
|
||||
* so this sort parameter set back to old value after the query is executed.
|
||||
*
|
||||
*
|
||||
* for Custom Fields module
|
||||
*/
|
||||
$request_sort = $request->get('sort');
|
||||
|
@ -33,8 +33,9 @@ class Account extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'opening_balance' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'opening_balance' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -26,9 +26,10 @@ class Reconciliation extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'closing_balance' => 'double',
|
||||
'reconciled' => 'boolean',
|
||||
'transactions' => 'array',
|
||||
'closing_balance' => 'double',
|
||||
'reconciled' => 'boolean',
|
||||
'transactions' => 'array',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -30,8 +30,6 @@ class Transaction extends Model
|
||||
|
||||
protected $table = 'transactions';
|
||||
|
||||
protected $dates = ['deleted_at', 'paid_at'];
|
||||
|
||||
/**
|
||||
* Attributes that should be mass-assignable.
|
||||
*
|
||||
@ -64,8 +62,10 @@ class Transaction extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'amount' => 'double',
|
||||
'currency_rate' => 'double',
|
||||
'paid_at' => 'datetime',
|
||||
'amount' => 'double',
|
||||
'currency_rate' => 'double',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -34,12 +34,11 @@ class Company extends Eloquent implements Ownable
|
||||
*/
|
||||
protected $appends = ['location'];
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $fillable = ['domain', 'enabled', 'created_from', 'created_by'];
|
||||
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
'enabled' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
public $allAttributes = [];
|
||||
|
@ -15,7 +15,6 @@ use Bkwld\Cloner\Cloneable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
use Cloneable, Contacts, Currencies, HasFactory, Media, Notifiable, Transactions;
|
||||
@ -59,15 +58,6 @@ class Contact extends Model
|
||||
'created_by',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Sortable columns.
|
||||
*
|
||||
|
@ -20,15 +20,6 @@ class Dashboard extends Model
|
||||
*/
|
||||
protected $fillable = ['company_id', 'name', 'enabled', 'created_from', 'created_by'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Sortable columns.
|
||||
*
|
||||
|
@ -36,9 +36,10 @@ class Item extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'sale_price' => 'double',
|
||||
'purchase_price' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'sale_price' => 'double',
|
||||
'purchase_price' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,9 @@ class Media extends BaseMedia
|
||||
{
|
||||
use Owners, SoftDeletes, Sources, Tenants;
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $fillable = ['company_id', 'created_from', 'created_by'];
|
||||
|
||||
protected $casts = [
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
@ -43,7 +43,8 @@ class Recurring extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'auto_send' => 'boolean',
|
||||
'auto_send' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -25,7 +25,8 @@ class Report extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'settings' => 'object',
|
||||
'settings' => 'object',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -26,7 +26,8 @@ class Widget extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'settings' => 'object',
|
||||
'settings' => 'object',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -30,8 +30,6 @@ class Document extends Model
|
||||
|
||||
protected $appends = ['attachment', 'amount_without_tax', 'discount', 'paid', 'received_at', 'status_label', 'sent_at', 'reconciled', 'contact_location'];
|
||||
|
||||
protected $dates = ['deleted_at', 'issued_at', 'due_at'];
|
||||
|
||||
protected $fillable = [
|
||||
'company_id',
|
||||
'type',
|
||||
@ -67,8 +65,11 @@ class Document extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'amount' => 'double',
|
||||
'issued_at' => 'datetime',
|
||||
'due_at' => 'datetime',
|
||||
'amount' => 'double',
|
||||
'currency_rate' => 'double',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -40,9 +40,10 @@ class DocumentItem extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'price' => 'double',
|
||||
'total' => 'double',
|
||||
'tax' => 'double',
|
||||
'price' => 'double',
|
||||
'total' => 'double',
|
||||
'tax' => 'double',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -16,15 +16,6 @@ class DocumentItemTax extends Model
|
||||
|
||||
protected $fillable = ['company_id', 'type', 'document_id', 'document_item_id', 'tax_id', 'name', 'amount', 'created_from', 'created_by'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'amount' => 'double',
|
||||
];
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Document\Document')->withoutGlobalScope('App\Scopes\Document');
|
||||
|
@ -18,15 +18,6 @@ class DocumentTotal extends Model
|
||||
|
||||
protected $fillable = ['company_id', 'type', 'document_id', 'code', 'name', 'amount', 'sort_order', 'created_from', 'created_by'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'amount' => 'double',
|
||||
];
|
||||
|
||||
public function document()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Document\Document')->withoutGlobalScope('App\Scopes\Document');
|
||||
|
@ -15,15 +15,6 @@ class Module extends Model
|
||||
*/
|
||||
protected $fillable = ['company_id', 'alias', 'enabled', 'created_from', 'created_by'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Scope alias.
|
||||
*
|
||||
|
@ -34,15 +34,6 @@ class Category extends Model
|
||||
*/
|
||||
protected $fillable = ['company_id', 'name', 'type', 'color', 'enabled', 'created_from', 'created_by', 'parent_id'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'enabled' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
* Sortable columns.
|
||||
*
|
||||
@ -231,7 +222,7 @@ class Category extends Model
|
||||
|
||||
/**
|
||||
* Get the display name of the category.
|
||||
*/
|
||||
*/
|
||||
public function getDisplayNameAttribute()
|
||||
{
|
||||
return $this->name . ' (' . ucfirst($this->type) . ')';
|
||||
|
@ -40,8 +40,9 @@ class Currency extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'rate' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'rate' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -32,8 +32,9 @@ class Tax extends Model
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'rate' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'rate' => 'double',
|
||||
'enabled' => 'boolean',
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user