Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tips.php 711B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Model\Raharja;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Tips extends Model
  5. {
  6. //protected $connection = 'connection-name'; //jika menggunakan 2 DB modelnya harus dikasih ini
  7. //protected $primaryKey = 'your_key_name'; // set primarykeymu jika bukan ID
  8. protected $table = 'tips';
  9. protected $fillable = [
  10. 'title',
  11. 'content',
  12. 'user_id',
  13. 'thumbnail',
  14. 'sub_title',
  15. 'date_publish',
  16. ];
  17. public function tipsLike(){
  18. return $this->hasMany(TipsLikes::class, 'tips_id', 'id');
  19. }
  20. //public $incrementing = false; //jika primary keynya string
  21. //public $timestamps = false; //matiin created_at, updated_at
  22. }