Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to get data from a table in laravel

use IlluminateSupportFacadesDB;

class UserController extends Controller
{
    public function index()
    {
        $users = DB::table('users')->select('id','name','email')->get();

        return view('some-view')->with('users', $users);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #data #table #laravel
ADD COMMENT
Topic
Name
8+3 =