Q:

Laravel best practices

$post = Post::find(1);$post->comments()->saveMany([ new Comment(['message' => 'First comment']), new Comment(['message' => 'Second comment']),]);
1
class User extends Model
{
    public function phone()
    {
        return $this->hasOne('App\Phone');
    }
}
0

New to Communities?

Join the community