belongsTo(User::class, 'user_id', 'id', __FUNCTION__); } public function rules() { return [ 'user_id' => 'required|integer|exists:users,id', 'agent' => 'required|string', 'ip' => 'required|ip', 'os' => 'required|string', 'latitude' => 'required', 'longitude' => 'required', 'token' => 'required|string|min:60', 'fcm_token' => 'nullable', ]; } }