%PDF- %PDF-
Direktori : /var/www/html/camillo/camillo-api-master/app/Models/ |
Current File : /var/www/html/camillo/camillo-api-master/app/Models/Festivity.php |
<?php namespace App\Models; use App\Scopes\FestivityScope; use App\User; use Illuminate\Database\Eloquent\Model; use Watson\Validating\ValidatingTrait; class Festivity extends Model { use ValidatingTrait; protected $table = 'festivities'; protected $fillable = [ 'schoolyear_id', 'description', 'start_date', 'end_date', 'created_by', 'updated_by' ]; protected $dates = [ 'created_at', 'updated_at', 'start_date', 'end_date' ]; protected $rules = [ 'start_date' => "required|date", 'end_date' => 'required|date', 'schoolyear_id' => 'required|integer|exists:schoolyears,id', 'description' => 'required|string', ]; /** * Validation messages to be passed to the validator. * * @var array */ protected $validatingMessages = []; protected static function boot() { parent::boot(); static::addGlobalScope(new FestivityScope); } public function schoolyear(){ return $this->belongsTo(Schoolyear::class); } public function creator() { return $this->belongsTo(User::class); } public function updater() { return $this->belongsTo(User::class); } }