![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/clinic.corals.io/app/Models/ |
<?php namespace App\Models; use Eloquent as Model; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Support\Carbon; /** * Class State * * @package App\Models * @version July 29, 2021, 11:48 am UTC * @property string $name * @property integer $country_id * @property int $id * @property Carbon|null $created_at * @property Carbon|null $updated_at * @property-read \App\Models\Country $country * @method static \Illuminate\Database\Eloquent\Builder|State newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|State newQuery() * @method static \Illuminate\Database\Eloquent\Builder|State query() * @method static \Illuminate\Database\Eloquent\Builder|State whereCountryId($value) * @method static \Illuminate\Database\Eloquent\Builder|State whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|State whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|State whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|State whereUpdatedAt($value) * @mixin Model */ class State extends Model { use HasFactory; protected $table = 'states'; public $fillable = [ 'name', 'country_id', ]; /** * The attributes that should be casted to native types. * * @var array */ protected $casts = [ 'name' => 'string', 'country_id' => 'integer' ]; /** * Validation rules * * @var array */ public static $rules = [ 'name' => 'required|unique:states,name', ]; /** * * @return BelongsTo */ public function country() { return $this->belongsTo(Country::class, 'country_id'); } }