Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel check if model has relation

use AppModelsPost;
 
// Retrieve all posts that have at least one comment...
$posts = Post::has('comments')->get();
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #check #model #relation
ADD COMMENT
Topic
Name
2+9 =