adminlte show data on dashboard code example

Example 1: adminlte show data on dashboard

public function index()
{
  $data = PdTpainlevel::select('pkpainlevel as id', 'painlevel_name as name')->get();

  return view('painlevel', compact('data'));

}

Example 2: adminlte show data on dashboard

Route::get('/admin/painlevel', 'V1\PainLevelController@index');

Example 3: adminlte show data on dashboard

public function index()
{
     return PdTpainlevel::select('pkpainlevel as id', 'painlevel_name as name')->get();
}

Example 4: adminlte show data on dashboard

Route::get('/admin/painlevel', function () {
    return view('painlevel');
});