Answers for "useing relationship in laravel"

PHP
0

laravel relationship

$comment = Post::find(1)->comments()
                    ->where('title', 'foo')
                    ->first();
Posted by: Guest on May-26-2021
0

laravel relationship

$model->relation; // result of the relation, ie. null/model for x-1 relations or collection for x-m
$model->relation(); // relation object
Posted by: Guest on July-13-2021

Browse Popular Code Answers by Language