Category : laravel-6

im currently trying to figure out, how to conditionally change the mailserver. The Mail is a Notification, which gets send via the queue worker. I tried multiple approaches such as: Setting the Config dynamically with Config::set, using a Middleware and removing the MailserviceProvider etc. But the Mail still gets send out via the mailserver that ..

Read more

I’m trying to understand the following. On my config/app.php I’m having my local timezone set to: ‘timezone’ => ‘Europe/Athens’ My Postgres is set to: SHOW timezone; // returns UTC In the inserted rows in Postgres i would expect to see my local timezone, converted to UTC. Instead, the timestamp is written on my local timezone. ..

Read more

I have been working to debug an old Laravel app made by another coder. In the code below, transaction->get() returns rows from DB. In this case, one row. The count returns one, and even if I var_dump(transactions[0]->id) I will get the response. But, when I do each on it, it fails and if I comment ..

Read more

I have an object that consists of multiple data as controlNumber each controlNumber has shipment.qty what I want is to total the qty of each same controlNumber and display one controlNumber with total qty. collection is below "collection": [ { "id": 983, "controlNumber": 4498818, "ItemNumber": "PS2W12077", "shipment": { "id": 27, "Item": "PS2W12077", "ColorCode": "GRPFR", "qty": ..

Read more

I have two collection as follows. $openorder_data = OpenorderImportTemp::select(‘id’, ‘controlNumber’, ‘ItemNumber’)->orderby(‘id’, ‘desc’)->where(‘ControlNumber’, ‘!=’, ‘0’)->get(); $shipment_data = ShipmentImportTemp::select(‘id’, ‘Po’, ‘Item’)->orderby(‘id’, ‘desc’)->where(‘Po’, ‘!=’, ‘0’)->get(); what I wanted to do is find the same recode on $shipment_data and $openorder_data using ItemNumber, and Item columns. both ItemNumber, and Item columns will have same value on this two different collection. ..

Read more

Updated Laravel to version 6, but an error appeared at the validation stage Illuminate Validation ValidationException The given data was invalid. /vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php * Get data to be validated from the request. * * @return array */ public function validationData() { return $this->all(); } /** * Handle a failed validation attempt. * * @param IlluminateContractsValidationValidator $validator ..

Read more

could not validate an array of input in laravel 8. from the frontside I have gotten the serialized form data which was successfully accessible from the backend. public function GetForm(Request $request) { $request = $request->all(); $input = array(); parse_str($request[‘data’], $input); return $input; } output: { "inputID":"26", "inputName":"Julie Hughes est", "inputPhone":"+94111222333", "inputEmail":"[email protected]" } what I want ..

Read more

I have a route that looks like this: Route::namespace(‘ApiHelpGuides’)->prefix(‘help’)->group(function () { Route::get(‘/{userInput}’, ‘FetchArticlesController’) ->where(‘userInput’, ‘.*’); }); And the controller that looks like this: public function __invoke(Request $request, string $userInput) … I want to be able to capture the $userInput so if I receive a request from the front-end that is like: /api/help/anything/could/be/in/here?including=params That I can ..

Read more

I’ve 2 create in the same function store, but one field of the 1th create it must be the same of a field in the 2th create. Is it possible? DataController.php public function store(Request $request) { SendData::create($request->validated()); // How I take here data from firt ::create ?? $random_data_from_form1 = ?? $data_from_form2 = $request->input(‘data_form2’); SendMoreData::create([ ‘field1’ ..

Read more

I’m trying to add some default value to a specific parameter if there isn’t any value already set. I’ve already tried the following code in the register function of the AppServiceProvider class but it’s not working: $this->app->extend(‘route’, function ($name, $parameters, $absolute, $app) { if (!in_array(‘locale’, $parameters)) { $parameters[‘locale’] = app()->getLocale(); } return route($name, $parameters, $absolute); ..

Read more