Last active
October 1, 2016 07:00
-
-
Save nasirkhan/ca73c2d50c0e0de4d0176ef4541ce819 to your computer and use it in GitHub Desktop.
Show Name and Code as Text using Laravel Lists method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Show Name and Code as Text using Laravel Lists method, | |
| // this array of data will be passed as value to prepate HTML Select Dropdown | |
| $institutes = Institute::select(DB::raw("CONCAT(name,' (', code, ')') AS text, id"))->lists('text', 'id')->take(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment