Last change
on this file since 0c07a90 was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
352 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace App\Models;
|
---|
4 |
|
---|
5 | use Illuminate\Support\Carbon;
|
---|
6 | use Illuminate\Database\Eloquent\Model;
|
---|
7 |
|
---|
8 | class Comment extends Model
|
---|
9 | {
|
---|
10 | protected $table = "comments";
|
---|
11 |
|
---|
12 | public function post() {
|
---|
13 | return $this->belongsTo(Post::class);
|
---|
14 | }
|
---|
15 |
|
---|
16 | public function ago() {
|
---|
17 | return Carbon::parse($this->created_at)->diffForHumans();
|
---|
18 | }
|
---|
19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.