Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel create model for existing table

<?php

namespace App;


class Post extends Model
{
    protected $table = 'master_posts';
    public const CREATED_AT = 'created_timestamp';
    public const UPDATED_AT = 'updated_timestamp';
    protected $primaryKey = 'pid';
}
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #laravel #create #model #existing #table
ADD COMMENT
Topic
Name
3+3 =