mardi 28 février 2017

Laravel Newbie ? about DB controller

I'm learning Laravel and I tried to create a page where Laravel populates a table from DB, but I have an error (I did everythin what was in this PDF file (Page 67-69))

Error message:

FatalThrowableError in ListProductsController.php line 16: Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION)

ListProductsController.php

    <?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class ListProductsController extends Controller
{
    public function inventory(){
    $inventory = DB::select('select * from inventory');
    return view('inventory',['inventory'=>$inventory]);
}

My route:

Route::get('inventory','ListProductsController@inventory');

What goes wrong?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire