Skip to content

Instantly share code, notes, and snippets.

@chrisliuqq
Created March 16, 2016 08:33
Show Gist options
  • Save chrisliuqq/2bf5fcfaefa802f94080 to your computer and use it in GitHub Desktop.
Save chrisliuqq/2bf5fcfaefa802f94080 to your computer and use it in GitHub Desktop.
get laravel table schema in model
<?php
public function getTableColumns()
{
return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment