all(); $user = Auth::user(); try { $profile = User::where(['id'=>$p['id']])->first(); $profile->permissions = implode(",",$p['permissions']); $profile->update(); $return = back()->with("mesaj","Yetkiler başarıyla güncellendi"); } catch(\Exception $e) { $hata = substr($e,0,100); $return = back()->with("hata","Yetkiler kaydedilmedi. Hata kodu: $hata"); } echo $return;