Skip to content

Instantly share code, notes, and snippets.

@minons1
Created June 26, 2021 19:15
Show Gist options
  • Save minons1/0a454564e62e927b2b242a7903c97df9 to your computer and use it in GitHub Desktop.
Save minons1/0a454564e62e927b2b242a7903c97df9 to your computer and use it in GitHub Desktop.
class BlogModel extends Model
{
protected $table = 'blog';
protected $primaryKey = 'blog_id';
protected $useAutoIncrement = true;
protected $insertID = 0;
protected $protectFields = true;
protected $allowedFields = ['blog_id','blog_title', 'blog_description'];
// Dates
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment