Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 71 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2.  
  3. namespace App;
  4.  
  5. use Illuminate\Database\Eloquent\Builder;
  6. use Illuminate\Database\Eloquent\Model;
  7. use Illuminate\Database\Eloquent\SoftDeletes;
  8.  
  9. class CompanyFinancial extends Model
  10. {
  11.     use SoftDeletes;
  12.  
  13.     protected $table = 'company_financial';
  14.  
  15.     protected static function boot()
  16.     {
  17.         parent::boot();
  18.  
  19.         // Order by name ASC
  20.         static::addGlobalScope('order', function (Builder $builder) {
  21.             $builder->orderBy('financial_year', 'asc');
  22.             $builder->orderBy('financial_quarter', 'asc');
  23.         });
  24.     }
  25.  
  26.     public function company()
  27.     {
  28.         return $this->belongsTo(Company::class);
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top