Last active
March 28, 2020 21:46
-
-
Save nwaughachukwuma/863acac7bcede6d9481a22846bbe0090 to your computer and use it in GitHub Desktop.
A comment model with it's relationship
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
use Illuminate\Database\Eloquent\Model; | |
class Comment extends Model | |
{ | |
public function post() | |
{ | |
return $this->belongsTo('\App\Post'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment