Category : api

2021-07-29 18:38:36.528495+0300 Runner[7225:3339676] flutter: selected Languageenglish 2021-07-29 18:38:36.534379+0300 Runner[7225:3339676] [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: Null check operator used on a null value #0 _CreateNewAccountState.callRegisterAPI.<anonymous closure> (package:mealup/screens/auth/create_new_account.dart:543:49) #1 _rootRunUnary (dart:async/zone.dart:1362:47) #2 _CustomZone.runUnary (dart:async/zone.dart:1265:19) #3 _FutureListener.handleError (dart:async/future_impl.dart:172:20) #4 Future._propagateToListeners.handleError (dart:async/future_impl.dart:719:47) #5 Future._propagateToListeners (dart:async/future_impl.dart:740:24) #6 Future._completeError (dart:async/future_impl.dart:550:5) #7 _completeOnAsyncError (dart:async-patch/async_patch.dart:274:13) #8 _RestClient.register (package:mealup/network_api/api_client.g.dart) <asynchronous suspension> i am trying to run ..

Read more

I have a stored procedure that returns me three tables (3 Selected) in Laravel when a call the procedure Public function getTables(Request $request){ $output =DB::select(‘call all_result(?,?)’, array($request->in1,$request->in2)); return response()->json($output); } Result: return only first table, i need 3 tables together Update: Stored Procedure DELIMITER $$ create procedure all_result() BEGIN select * from table1; select * ..

Read more

We have an application (C#) that up till today has worked fine. It communicates with a laravel website to manage the sites data. So there are some validation points that occur, the application does checks with out SSO provider for authentication. Then it passes some of the user’s information over to the site so the ..

Read more

I am trying to make an api authentication system with email verification but i get this error in postman: "message": "Connection could not be established with host smtp.mailtrap.io :stream_socket_client(): unable to connect to tcp://smtp.mailtrap.io:25 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed ..

Read more

I have a model called Address. It has an ‘additional’ attribute. Although the attribute is filled, the model returns an empty array. I use an API resource to get the data. This is the Address model: <?php namespace AppModels; use IlluminateDatabaseEloquentFactoriesHasFactory; use IlluminateDatabaseEloquentModel; class Address extends Model { use HasFactory; /** * The table associated ..

Read more

In my API after the user registers, a token is created with this code : $token = JWTAuth::fromUser($user); when i use dd($token) , returns this : eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xMjcuMC4wLjE6ODAwMFwvYXBpXC9sb2dpbiIsImlhdCI6MTYyNjgxNDM2NCwiZXhwIjoxNjI2ODE3OTY0LCJuYmYiOjE2MjY4MTQzNjQsImp0aSI6Imd3eDZnVzNGTGN4MzlMekIiLCJzdWIiOjQsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ._m-7tojFaupUbAibDUbLJm6BeuFVL_etdFlwj0h5664 so how can i find the id of user without entering this token in authorization of postman ? Sourc..

Read more

Controller method: public function getItem() { try{ // Some codes return $result; } catch(Exception $e) { LOG::error($e->getMessage()); throw new Exception ("$e->getMessage ()",500); } } Test file: public function testGetItem() { $this->get(‘api/getitem’)->assertStatus(200); } This only covers the try condition in the code. How can I catch the exception to cover 100% code coverage report? Sourc..

Read more

I’m code update status for category. I got new function in API Controller, when i click submit it’s not work at new function i have created. This is solved when it move on category.update – but i can’t because that function used for something else. Please help me, thank a lot. web.php Route::patch(‘category/{$category}’,’[email protected]’)->name(‘category.change’); Route::resource(‘category’, ‘AdminCategoryController’)->middleware(‘loggedin’); ..

Read more

Trying to simulate a POST request on postman for a callback function for API. It is from an external API posting the data to me so I did not include return in callback function. Here is my route: Route::post(‘toyyibpay-callback’,’[email protected]’)->name(‘toyyibpay-callback’); Controller: public function callback(Request $request){ Log::info(‘callback function is called’); $response = request()->all(); Log::info($response); if($request->status == 1){ ..

Read more

I’m working with laravel 6.x and 8.x for my applications. I was trying to find a way to protect my api routes with csrf protection, but it seems impossible to do it. So I looked for another way to protect my api routes, and I found Laravel Passport : https://laravel.com/docs/8.x/passport I keep reading the documentation ..

Read more