<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SerpResult extends Model { use HasFactory; protected static function booted():void{static::saving(function(self $result):void{if($result->position<1)throw new \InvalidArgumentException('Position pozitif olmalıdır.');});} protected $guarded=[]; protected function casts():array{return ['is_project_domain'=>'boolean'];} public function serpCheck():BelongsTo{return $this->belongsTo(SerpCheck::class);} }