Created
November 2, 2015 11:00
-
-
Save varyym/1e69c4b182eed0fa2353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use SleepingOwl\Models\SleepingOwlModel; | |
class Company extends SleepingOwlModel | |
{ | |
public static function boot() | |
{ | |
parent::boot(); | |
static::deleting(function ($item) | |
{ | |
//dd('Deleting event handler executed on item #' . $item->id); | |
}); | |
} | |
protected $fillable = [ | |
'title', | |
'address', | |
'phone', | |
'mydate' | |
]; | |
protected $hidden = [ | |
'created_at', | |
'updated_at' | |
]; | |
public function scopeDefaultSort($query) | |
{ | |
return $query->orderBy('title', 'asc'); | |
} | |
public function contacts() | |
{ | |
return $this->belongsToMany('Contact'); | |
} | |
public static function getList() | |
{ //dd(static::lists('title', 'id')->all()); | |
//return static::lists('title', 'id')->all(); | |
return ["1"=>"2"]; | |
} | |
public function getDates() | |
{ | |
return array_merge(parent::getDates(), ['mydate']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment