/home/techb158/ileadtechnology.com/SSM/app/Models/library
Edit: /home/techb158/ileadtechnology.com/SSM/app/Models/library/BookPostDetail.php (1783B)
'array'];
protected $primaryKey = 'id';
protected $table = 'book_post_details';
protected static $logName = 'book_post_detail';
protected static $logFillable = true;
protected static $logOnlyDirty = true;
protected static $ignoreChangedAttributes = ['updated_at'];
public function bookPost()
{
return $this->belongsTo('App\Models\Library\BookPost');
}
public function bookCondition()
{
return $this->belongsTo('App\Models\Configuration\Library\BookCondition');
}
public function bookLogDetails()
{
return $this->hasMany('App\Models\Library\BookLogDetail');
}
public function scopeInfo($q)
{
return $q->with('bookPost', 'bookPost.book');
}
public function scopeFilterById($q, $id)
{
if (! $id) {
return $q;
}
return $q->where('id', '=', $id);
}
public function scopeFilterByNumber($q, $number)
{
if (! $number) {
return $q;
}
return $q->where('number', '=', $number);
}
public function scopeFilterByAvailability($q)
{
return $q->where('is_not_available', '=', 0);
}
}