File manager - Edit - /home/bookdonate/htdocs/bookdonate.in/app/Book.php
Back
<?php namespace App; use Illuminate\Database\Eloquent\Model; // Models Books within the system class Book extends Model { protected $guarded = []; // Eloquent relationship with the user model: A book belongs to a student who is selling it public function user() { return $this->belongsTo('App\User'); } // Eloquent relationship with the category model, a book belongs to a category public function category() { return $this->belongsTo('App\Category'); } // Scope query used to filter results that are greater than a given price public function scopePriceGreaterThan($query, $price) { return $query->where('price', '>', $price); } // Scope query used to filter results that are less than a given price public function scopePriceLessThan($query, $price) { return $query->where('price', '<', $price); } }
| ver. 1.4 |
Github
|
.
| PHP 8.2.16 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings