skip to Main Content

How can I shorten Laravel API response time?

I was pulling the data this way, but when I query with Postman, it takes too long to get the response. public function getAllItems(Request $request) { $type = $request->input('type'); $query = Item::query(); if ($type === 'series') { $query->where('is_series', true); }…

VIEW QUESTION

Laravel API Call to a member function createToken() on null

AuthController namespace AppHttpControllersApi; use AppHttpControllersController; use AppModelsUser; use AppHttpRequestsApiRegisterRequest; use IlluminateHttpRequest; use IlluminateSupportFacadesAuth; class AuthController extends Controller { public function signUp(RegisterRequest $request) { $data = $request->validated(); $user = User::create($data); Auth::attempt(['username'=>$data['username'], 'password'=>$data['password']]); $token = auth()->user()->createToken($data['username']); return response([ 'status' => 'success', 'username'…

VIEW QUESTION
Back To Top
Search