vendredi 31 août 2018

Laravel Undefined Variable in View from database

i tried to show some data from database to my view. But i get undefined variable error.

Route::get('pages/tab-content-games', 'Admin\TournamentCrudController@get_data');

and this is my function

public function get_data(){
    $data['data'] = \DB::table('tournament')->get();
    return view('pages.tab-content-games', ['data' => $data]);
}

in tab-content-games.blade.php i just print the variable



can someone helped me, what part i'm doing wrong. thankyou




Aucun commentaire:

Enregistrer un commentaire