• File: PostComment.php
  • Full Path: /var/www/paytekchalenge/app/Models/PostComment.php
  • Date Modified: 07/19/2022 7:23 PM
  • File size: 580 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;

class PostComment extends Model
{
    protected $fillable = [
      'comment', 'post_id', 'member_id'
    ];

    protected function serializeDate(DateTimeInterface $date)
    {
//        $date->format('d-m-Y H:i:s');
        return $date->format('H:i');
    }

    public function post(){
      return $this->belongsTo('App\Models\Post','post_id');
    }

    public function member(){
      return $this->belongsTo('App\Models\Member','member_id');
    }
}