Laravel
Laravel モデルからTable名を取得
Models namespace App\Models; use Illuminate\Database\Eloquent\Model; class SomeModel extends Model { public function getTableColumns() { return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable()); } } Contorller $mdl = new SomeModel(); $tbl = $mdl->getTableColumns();