Answers for "laravel inverse one to many relationship"

PHP
0

laravel inverse one to many relationship

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    /**
     * Get the post that owns the comment.
     */
    public function post()
    {
        return $this->belongsTo(Post::class);
    }
}
Posted by: Guest on June-10-2021

Code answers related to "laravel inverse one to many relationship"

Browse Popular Code Answers by Language