%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/camillo/camillo-api-master/app/Models/
Upload File :
Create Path :
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);
    }

}

Zerion Mini Shell 1.0