I am trying to run a python script within my laravel project using Symfony’s process component: https://symfony.com/doc/current/components/process.html My code is within a controller and looks like this: $process = new Process([ ‘python’, ‘–version’ ]); $process->run(); if(!$process->isSuccessful()) { throw new ProcessFailedException($process); } dd($process->getOutput()); The error I get is the following: The command "python –version" failed. Exit ..

Read more

I am trying to create a new contact using Xero oAuth 2.0 and getting this error: [401] Client error: `PUT https://api.xero.com/api.xro/2.0/Contacts?summarizeErrors=true` resulted in a `401 Unauthorized` response: I have got my scopes as: ‘scopes’ => [ ‘openid’, ’email’, ‘profile’, ‘offline_access’, ‘accounting.settings’, ‘accounting.contacts’, ‘accounting.reports.read’, ], I am able to connect to get the message The App ..

Read more

I have this JSON data when I saved. I have a total of 43 data inside this JSON. "{"question":["1","1","1","1","1","1","1","2","2","3","3","2","2","1","3","2","1","2","3","1","2","3","3","3","2","1","2","3","1","2","3","1","2","3","1","2","3","1","2","3","1","2","3"]} Then, I’m trying to calculate the score of this JSON data using this calculation. But it not calculate it because I did not get the JSON data value. I tried dd($survey_score) and it just totals up ..

Read more

Got a OOP theory question here, since i’m new to this kinda stuff, coming from mostly a JS flow. Let’s say i have a controller and method MyController::getAllData .It uses eloquent to fetch 2 different types of datasets that have almost no relations (and they shouldn’t). After fetching i need to go through a few ..

Read more

I’ve problem, I’m trying to redirect users when they log in by role to their dashboard using middleware in laravel 6. But I’m stucked can’t figure out where is the problem in this condition. Please help, thanks kindly. Each role has this route web.php Route::group([ ‘as’=>’user.’, ‘prefix’=>’user’, ‘namespace’=>’User’, ‘middleware’=>[‘auth’,’user’]], function(){ Route::get(‘dashboard’, ‘[email protected]’)->name(‘dashboard’); }); Middleware looks ..

Read more

if I include the mathjax and mathjs files directly to my app.blade.php file everything works. <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-chtml.js"></script> <script src="{{asset(‘/js/math.min.js’)}}" type="text/javascript"></Script> <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script> MathJax = { tex: {inlineMath: [[‘$’, ‘$’], [‘(‘, ‘)’]]} }; </script> however if I do this the composer way : first I install the packages: composer require components/mathjs composer require ..

Read more

I’m inserting multiple data into the database. There is an error for my column report_by which is SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘report_by’ cannot be null (SQL: insert into ‘complaints’ (‘defect_id’, ‘image’, ‘description’, ‘report_by’) values (1, C:wamp64tmpphp8E2E.tmp, leak, ?)) Inside column report_by should be the id of the user by using Auth. users table ..

Read more

i am getting this error after i press save button in settings menu Error Name: ErrorException (E_WARNING) Creating default object from empty value Following error on line no.s ErrorException …/app/Http/Controllers/SettingController.php226 69 IlluminateFoundationBootstrapHandleExceptions handleError …/app/Http/Controllers/SettingController.php226 61 IlluminateRoutingPipeline IlluminateRouting{closure} …/app/Http/Middleware/IsAdmin.php30 58 IlluminateRoutingPipeline IlluminateRouting{closure} …/app/Http/Middleware/Localization.php21 24 IlluminateRoutingPipeline IlluminateRouting{closure} …/app/Http/Middleware/RedirectIfUpdateAvailable.php25 21 IlluminateRoutingPipeline IlluminateRouting{closure} …/app/Http/Middleware/RedirectToInstallerIfNotInstalled.php22 0 IlluminateFoundationHttpKernel handle …/public/index.php55 Code ..

Read more

I am beginner php developer. I have small problem with my array. I use in my project Laravel 7 I have this code: $items = collect($discount->products->toArray()); It’s result me: IlluminateSupportCollection {#1783 ▼ #items: array:2 [▼ 0 => array:17 [▼ "id" => 1 "product_category_id" => 5 "image_id" => null "vat_type_id" => 1 "name" => "Produkt 1" ..

Read more