Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get table name from model laravel

class BaseModel extends Eloquent {

    public static function getTableName()
    {
        return with(new static)->getTable();
    }

}

class User extends BaseModel {

}


User::getTableName();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #table #model #laravel
ADD COMMENT
Topic
Name
4+6 =