Category : lumen

Recently I have migrated one of my projects (PHP 7.4/Lumen/Ubuntu 20.04) from MongoDB to MongoDB compatible AWS DocumentDB. Since the migration all the CLI Scripts are triggering this strange notice/warning bson_append_array(): invalid array detected. first element of array parameter is not "0". Everything seems to be functionally working apart from this message (Even though I ..

Read more

i’ve already trying array_key_exists(). But when it should return the expected result, lumen display error message that i need to use another php function instead of array_key_exists() like isset() or property_exists() as mentioned in this question title. $jsonData = "mydata.json"; $content = file_get_contents($jsonData); $unsortedData = json_decode($content, true); //convert array to object $object = (object) $unsortedData; ..

Read more

My api works fine in postman but in browser I get CORS error. my frontend project is served on localhost:3000 and here’s my ajax code: $.ajax({ url : ‘localhost:8000/api/login’, type : ‘POST’, data : { ’email’ : email, ‘password’:password }, dataType: ‘json’, success : function(data) { console.log(data) }, error : function(request,error){ console.log(request,error) } }); And ..

Read more

I have this code, but it throw an error when i try to use it even in simplest way. <?php namespace AppJobs; use IlluminateSupportFacadesLog; class RefreshUploadedFileId extends Job { public function __construct() { // } public function handle() { Log::info(‘Hi, you reached here!’); } } Usage: use AppJobsRefreshUploadedFileId; dispatch(new RefreshUploadedFileId); Error message: Trying to access ..

Read more

I have an http client request like this? try { $request = json_encode($data); $result = $this->pendingRequest->{$method}(‘http://test.local/general/wallets/1000000’, $data); // this is my request detail $request = $result->transferStats ? Message::toString($result->transferStats->getRequest()) : $request; $result->throw(); $this->setLog($provider, $step, $request, $result->body(), $url, $result->status()); return $result; } catch (RequestException $exception) { // I need to http request detail } catch (ConnectionException $exception) ..

Read more

I’m developing an app with Lumen Framework which needs to use SoapClient to communicate with Magaya Software. My app is hosted in Heroku, and has been worked well for few months. 3 days ago I realized that quotations transactions with magaya were failing. I tested the endpoint with postman and I get ‘500 Internal Server ..

Read more

I have read through the documentation and a few tutorials. Sadly, I can’t seem to find any documentation on what is returned and what functions are available for use when using Eloquent. Maybe I am just missing it. However, I am using this code in my controller. public function find($userName){ $user = UserSecurity::where(‘userName’, $userName)->get(); //dd($user); ..

Read more