How to get table name from model in Laravel 5?By Hardik Savani | August 22, 2016 | | 3856 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();
- Display preview selected image in input type file using JQuery
- Laravel 5 - How to implement gravatar image using thomaswelton/laravel-gravatar package
- How to create Laravel Resource Controller example?
- AngularJS tooltip using UI Bootstrap tpls HTML example with demo
- Laravel 5 Ajax CRUD with Pagination example and demo from scratch
- Solve - Installation request for guzzle/guzzle in laravel
- How to send mail using mailable in laravel 5.3?
- How to confige Elasticsearch in our local system