lundi 19 décembre 2016

using POST instead of PUT in laravel

I'm using Laravel to build and api based admin control application and I'm using Route:resource instead of regular GET and POST methods.

Just realized my hosting provider DOESN'T ALLOW PUT and DELETE now I need to so now I have to use POST and GET methods.

this is what i have

Route::resource('contacts', 'Admin\\ContactInfoController',['only' => ['create', 'store', 'update']]);
    Route::get('claims/statuses', 'Admin\\ClaimsController@statusCodes');
    Route::get('claims/costcenters', 'Admin\\ClaimsDetailsController@getCostCentres');
    Route::get('claims/{id}/details', 'Admin\\ClaimsController@details');
    Route::get('claims/{id}/messages', 'Admin\\ClaimsController@messages');
    Route::resource('claims', 'Admin\\ClaimsController',['only' => ['index','store','update','destroy','edit']]);
    Route::resource('claims/details', 'Admin\\ClaimsDetailsController',['only' => ['store','update','destroy']]);

What approach might be best in converting my routes from PUT and DELETE to POST and GET?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire