| Server IP : 77.68.25.176 / Your IP : 216.73.216.25 Web Server : Apache System : Linux plesk 4.15.0-159-generic #167-Ubuntu SMP Tue Sep 21 08:55:05 UTC 2021 x86_64 User : dwp ( 10001) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/dazzlingwebplanet.co.uk/tap2teach.dazzlingwebplanet.com/app/Models/ |
Upload File : |
<?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* Class Requests
* @package App\Models
* @version April 6, 2021, 3:39 pm UTC
*
* @property integer $user_id
* @property string|\Carbon\Carbon $datetime
* @property integer $subject_id
* @property integer $year_group_id
* @property string $description
* @property integer $status_id
*/
class Requests extends Model
{
use SoftDeletes;
use HasFactory;
public $table = 'request';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
protected $dates = ['deleted_at'];
public $fillable = [
'user_id',
'datetime',
'subject_id',
'year_group_id',
'description',
'cancel_by_teacher',
'status_id'
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'user_id' => 'integer',
'datetime' => 'datetime',
'subject_id' => 'integer',
'year_group_id' => 'integer',
'description' => 'string',
'cancel_by_teacher' => 'boolean',
'status_id' => 'integer'
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
'user_id' => 'required|integer',
'datetime' => 'required',
'subject_id' => 'required',
'year_group_id' => 'required',
'description' => 'required|string',
'status_id' => 'required|integer',
'cancel_by_teacher' => 'nullable',
'deleted_at' => 'nullable',
'created_at' => 'nullable',
'updated_at' => 'nullable'
];
public function student()
{
return $this->belongsTo(UserDetail::class, 'user_id');
}
public function subject()
{
return $this->belongsTo(SchoolSubject::class, 'subject_id');
}
}