for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Rougin\Wildfire\Traits;
/**
* Model Trait
*
* @package Wildfire
* @author Rougin Royce Gutib <[email protected]>
*/
trait ModelTrait
{
* Columns that will be displayed.
* If not set, it will get the columns from the database table.
* @var array
protected $columns = [];
* Columns that will be hidden in the display.
* If not set, it will hide a "password" column if it exists.
protected $hidden = [ 'password' ];
* Model's default primary key or unique identifier.
* @var string
protected $primary_key = 'id';
* The table associated with the model.
protected $table = '';
* Returns the specified columns of the model.
* @return array
public function getColumns()
return $this->columns;
}
* Returns the specified hidden columns of the model.
public function getHiddenColumns()
return $this->hidden;
* Gets the specified primary key of the model.
* @return string
public function getPrimaryKey()
return $this->primary_key;
* Gets the specified table name of the model.
public function getTableName()
if (! $this->table) {
return plural(strtolower(get_class($this)));
return $this->table;