How i can call controller function using JavaScript !?
Controller:
public function archive($id)
{
$article = Article::find($id);
$article->public = 0;
$article->archive = 1;
$article->save();
}
Route:
Route::post('/archive/{id}', 'HomeController@archive');
I would be grateful for any working options. Thank you!