<?php namespace App\Http\Models; use Illuminate\Database\Eloquent\Model; class TemplateLibrary extends Model { protected $primaryKey = 'id'; protected $table = 'template_library'; public function templateLibraryRelation() { return $this->hasMany(TemplateLibraryRelation::class, 'template_library_id', 'id'); } }