vendredi 15 janvier 2016

Routing issue with laravel 5.1 http exceptions

Hi Guys i have been having this problem when i try to get history by accessing stove.show or the controller show method it returns a NotFoundHttpException in RouteCollection.php line 161:

My controller looks like:

 public function getIndex()
{
   // $stoves = Stove::all();

    return view('stoves.index');
}

public function anyData()
{
    $stoves = Stove::select(['id','stoveno', 'refno', 'manufactuerdate', 'created_at']);
    return Datatables::of($stoves)
        ->addColumn('action', function ($stoves) {
            return '<a href="stove/show/'.$stoves->stoveno.'" class="btn btn-invert"><i class="glyphicon glyphicon-edit"></i> History</a>';
        })

        ->make(true);
}

public function addData()
{
    //
    return view('stoves.new');
}

public function store(AddStove $request)
{
   Stove::create($request->all());

       return redirect('stove');
}

public function getShow($id)
{
    $stove = Stove::findorFail('$id');
    return view('stoves.view', compact('stove'));
}

public function edit($id)
{
    //
}

public function update(Request $request, $id)
{
    //
}
public function destroy($id)
{
    //
}

My Route looks like:

Route::controller('stove', 'StoveController', [
'anyData'  => 'stove.data',
'getShow'  => 'stove.show',
'getIndex' => 'stove',
]);
Route::get('newstove', 'StoveController@addData');
Route::post('newstove', 'StoveController@store');

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire