jeudi 17 février 2022

Missing required parameter for [Route: ajax.offers.edit] [URI: ajax-offer/edit/{offer_id}] [Missing parameter: offer_id]

Route code

    Route::get('edit/{offer_id}' , [App\Http\Controllers\OfferController::class, 'editOffer'])->name('ajax.offers.edit');

Controller code

public function editOffer(Request $request)
{
    $offer = Offer::find($request -> offer_id);
    if(!$offer)
        return response()->json([
            'status' => false,
            'msg' => 'Offer is not exist',
        ]);

    $offer =Offer::select('id', 'name_en', 'name_ar', 'price', 'details_en', 'details_ar')->find($request->offer_id);
    return view('ajaxoffers.edit', compact('offer'));
}

View code

id)}}" class="delete_btn">Ajax Edit

so what's the problem



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire