I m try to insert data to db ! but function is working ok, it redirect to route assigned ! no error! but data is not getting added in db! I am not able to figure out ! anyhelp?
public function addfav($webmasterId,$id)
{
// Check Permissions
$data_sections_arr = explode(",", Auth::user()->permissionsGroup->data_sections);
if (Auth::user()->id =='1') {
return Redirect::to(route('NoPermission'))->send();
}
$dlt=DB::table('favads')->insertGetId([
['user_id' => Auth::user()->id, 'topic_id' => $id]
]);
//
// General for all pages
$GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get();
// General END
//Webmaster Topic Details
$WebmasterSection = WebmasterSection::find($webmasterId);
if (!empty($WebmasterSection)) {
return redirect()->route('fav',['webmasterId'=>$webmasterId]);
} else {
return redirect()->route('NotFound');
}
}