Breaking

Code Gripper
Responsive Advertisement
  • Home
Home

Call to undefined method App\Role::lists() in Laravel 8

byMahabubur Rahman -December 27, 2021
0

 The lists method deprecated since laravel 5.2 version.

 The lists method on the Collection, query builder and Eloquent query builder objects has been renamed to pluck.


So if you work on laravel 5.2 or newer version you mast use pluck rather then  lists  method.

Laravel 5.1 or older version - 

$roles = Role::lists('name', 'id');

Laravel 5.2 or newer version - 

$roles = Role::pluck('name', 'id');
  • Facebook
  • Twitter

You may like these posts

Post a Comment

Previous Post Next Post

Follow Us

Popular Posts

Subscribe Us

Facebook

Categories

Main Tags

Code Gripper

September 30, 2023

Total Pageviews

Search This Blog

CODE GRIPPER

Code Gripper
CODE GRIPPER

  • Home
  • Python
  • PHP

Menu Footer Widget

  • Home
  • About
  • Contact Us
Code Gripper

About Us

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.

Categories

Main Tags

Latest Posts

Most Popular

Design by Blogger | Distributed by Gooyaabi
  • Home
  • About Us
  • Contact Us
  • RTL Version

Contact Form