Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Builder;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class CompanyFinancial extends Model
- {
- use SoftDeletes;
- protected $table = 'company_financial';
- protected static function boot()
- {
- parent::boot();
- // Order by name ASC
- static::addGlobalScope('order', function (Builder $builder) {
- $builder->orderBy('financial_year', 'asc');
- $builder->orderBy('financial_quarter', 'asc');
- });
- }
- public function company()
- {
- return $this->belongsTo(Company::class);
- }
- }
Add Comment
Please, Sign In to add comment