Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ModelXe{
- protected $table = 'xxxxxx';
- public function __construct()
- {
- $listCol = DB::table('INFORMATION_SCHEMA.COLUMNS')
- ->select('COLUMN_NAME')
- ->where('TABLE_SCHEMA','=',env('DB_DATABASE'))
- ->where('TABLE_NAME','=',$this->table)->get();
- foreach($listCol as $colName){
- $c = $colName->COLUMN_NAME;
- $this->$c = null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement