How to get table name from model in Laravel 5?By Hardik Savani | August 22, 2016 | | 4983 Viewer | Category : Laravel
Share this post:
If you need to get table name from model in your laravel application then this post can help you to get table name. Laravel based on MVC. So, we require to create model for every table that way we can write database logic on model. But if you require to get table name from model then you can get using getTable() of model.
Laravel eloquent model provide several methos like for all(), get(), first() etc, that helps to get table record from model table.
You can get table name simply call getTable() of model object, so how to call this method as bellow example.
$item = new Item;
$table = $item->getTable();
- Laravel tokenmismatchexception in verifycsrftoken.php - Solved
- AngularJS - How to render HTML value in ng-repeat ?
- Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin
- How can i print php variable in jquery?
- How to change view mode in bootstrap datepicker like yyyy-mm?
- Jquery - draggable sortable table rows example demo with bootstrap
- How to upgrade node.js version in Ubuntu?
- Group by year month example in Laravel 5 using Query Builder