How to get table name from model in Laravel 5?By Hardik Savani | August 22, 2016 | | 9742 Viewer | Category : Laravel
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 5 - Barcode generator example using milon/barcode package
- Laravel 5 - Column sorting with pagination example from scratch
- How to get last inserted id in Codeigniter?
- How to add tooltip Bootstrap?
- How to send mail using Sendgrid in laravel 5?
- How to delete multiple records using checkbox in Laravel 5 ?
- How to parse json in jquery ajax?
- How to implement lazy loading image with example for your website?