Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel-check-if-related-model-exists

public function hasPosts(): bool
{
    return $this->posts()->exists();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
8+1 =