laravel 8
This commit is contained in:
@ -4,10 +4,11 @@ namespace App\Models\Setting;
|
||||
|
||||
use App\Abstracts\Model;
|
||||
use App\Traits\Transactions;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
use Transactions;
|
||||
use HasFactory, Transactions;
|
||||
|
||||
protected $table = 'categories';
|
||||
|
||||
@ -130,4 +131,14 @@ class Category extends Model
|
||||
{
|
||||
return (int) $query->other()->pluck('id')->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new factory instance for the model.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
protected static function newFactory()
|
||||
{
|
||||
return \Database\Factories\Category::new();
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,11 @@ namespace App\Models\Setting;
|
||||
use App\Abstracts\Model;
|
||||
use App\Traits\Contacts;
|
||||
use App\Traits\Transactions;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Currency extends Model
|
||||
{
|
||||
use Contacts, Transactions;
|
||||
use Contacts, HasFactory, Transactions;
|
||||
|
||||
protected $table = 'currencies';
|
||||
|
||||
@ -163,4 +164,14 @@ class Currency extends Model
|
||||
{
|
||||
return $query->where($this->table . '.code', $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new factory instance for the model.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
protected static function newFactory()
|
||||
{
|
||||
return \Database\Factories\Currency::new();
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,12 @@
|
||||
namespace App\Models\Setting;
|
||||
|
||||
use App\Abstracts\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Tax extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'taxes';
|
||||
|
||||
/**
|
||||
@ -127,4 +130,14 @@ class Tax extends Model
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new factory instance for the model.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
protected static function newFactory()
|
||||
{
|
||||
return \Database\Factories\Tax::new();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user