/**
  * Checks if a user has a specific char
  */
 public function checkPlayerChar($char_id)
 {
     if ($this->user_byond_linked == 1) {
         $char_count = \App\Models\ServerCharacter::where('id', $char_id)->where('ckey', $this->user_byond)->count();
         if ($char_count == 1) {
             return TRUE;
         } else {
             return FALSE;
         }
     } else {
         return NULL;
     }
 }
 public function getCharDataCkey($ckey, Request $request)
 {
     if ($request->user()->cannot('server_chars_show')) {
         abort('403', 'You do not have the required permission');
     }
     $chars = ServerCharacter::where('ckey', $ckey)->select(['id', 'name', 'ckey']);
     return Datatables::of($chars)->removeColumn('id')->editColumn('name', '<a href="{{route(\'server.chars.show.get\',[\'char\'=>$id])}}">{{$name}}</a>')->addColumn('action', '<p><a href="{{route(\'server.chars.show.get\',[\'char\'=>$id])}}" class="btn btn-success" role="button">Show</a>@can(\'ccia_record_edit\')<a href="{{route(\'server.chars.edit.cr.get\',[\'book\'=>$id])}}" class="btn btn-info" role="button">Edit CCIA Record</a>@endcan()</p>')->make();
 }
 /**
  * Check if the player "owns" a specific char
  * @param int char_id The id of the char that should be checked
  *
  * @returns bool
  */
 public function check_player_char($char_id)
 {
     return \App\Models\ServerCharacter::where('ckey', $this->ckey)->where('id', $char_id)->count() > 0;
 }