| 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 School
* @package App\Models
* @version April 2, 2021, 9:13 am UTC
*
* @property string $name
* @property string $description
* @property string $address_line_1
* @property string $address_line_2
* @property string $city
* @property string $postcode
* @property string $country
* @property boolean $status
*/
class School extends Model
{
use SoftDeletes;
use HasFactory;
public $table = 'schools';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
protected $dates = ['deleted_at'];
public $fillable = [
'name',
'description',
'address_line_1',
'address_line_2',
'city',
'postcode',
'country',
'status'
];
/**
* The attributes that should be casted to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'name' => 'string',
'description' => 'string',
'address_line_1' => 'string',
'address_line_2' => 'string',
'city' => 'string',
'postcode' => 'string',
'country' => 'string',
'status' => 'boolean'
];
/**
* Validation rules
*
* @var array
*/
public static $rules = [
'name' => 'required|string|max:255',
'description' => 'nullable|string|max:255',
'address_line_1' => 'nullable|string|max:255',
'address_line_2' => 'nullable|string|max:255',
'city' => 'nullable|string|max:50',
'postcode' => 'nullable|string|max:20',
'country' => 'required|string|max:255',
'status' => 'required|boolean',
'deleted_at' => 'nullable',
'created_at' => 'nullable',
'updated_at' => 'nullable'
];
public function subject()
{
return $this->hasMany(SchoolSubject::class, 'school_id');
}
public function year_group()
{
return $this->hasMany(SchoolYearGroup::class, 'school_id');
}
}