Beispiel #1
0
 /**
  * @param $instance_id
  * @return bool
  */
 public function ownsInstance($instance_id)
 {
     return (bool) User::instances()->where('instance_id', '=', $instance_id)->where('owner', '=', 1)->count();
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if (Gate::denies('destroy', [User::class, $id])) {
         Log::info('Access denied for user destroy.', ['auth_user' => auth()->user(), 'origin_ip' => request()->ip(), 'id' => $id]);
         abort(403);
     }
     return response()->json(["success" => (bool) User::destroy($id)]);
 }