%PDF- %PDF-
Direktori : /var/www/html/camillo/camillo-api-master/app/Models/ |
Current File : /var/www/html/camillo/camillo-api-master/app/Models/Subscription.php |
<?php namespace App\Models; use App\User; use Illuminate\Database\Eloquent\Model; use Watson\Validating\ValidatingTrait; class Subscription extends Model { use ValidatingTrait; protected $fillable = [ 'minor_id', 'classroom_id', 'start_date', 'end_date', 'active', ]; protected $dates = [ 'created_at', 'updated_at', 'start_date', 'end_date' ]; protected $rules = [ 'minor_id' => 'required|integer|exists:minors,id', 'classroom_id' => 'required|integer|exists:classrooms,id', 'start_date' => 'required|date', 'end_date' => 'nullable|date', 'active' => 'boolean', ]; /** * Validation messages to be passed to the validator. * * @var array */ protected $validatingMessages = []; public function minor() { return $this->belongsTo(Minor::class); } public function classroom() { return $this->belongsTo(Classroom::class); } }