troubleshooting Question

How do I get rid of the error: maximum execution time of 60 minutes exceeded, when loading a json file with laravel

Avatar of B O
B O asked on
LaravelPHPJSON
14 Comments1 Solution27 ViewsLast Modified:


code:
$contactInfo = Storage::disk('local')->exists('challenge.json') ? json_decode(Storage::disk('local')->get('challenge.json'), true) : [];
        
            // $json = $contactInfo[0]; // turn std object to array
            foreach ($contactInfo as $contactDetail ){
                $contact = new User; // assumes you have a Model called Contact
                $contact->name = $contactDetail['name'];
                $contact->address = $contactDetail['address'];
                $contact->checked = (!$contactDetail['checked'] === false) ? $contactDetail['checked'] : 'false';
                $contact->description = $contactDetail['description'];
                $contact->interest = (!$contactDetail['interest'] === null) ? $contactDetail['interest'] : 'null';
                $contact->date_of_birth = (!is_null($contactDetail['date_of_birth'])) 
                ? 
                substr(preg_replace("([^0-9/])", "", $contactDetail['date_of_birth']), 0, 8) 
                : 
                new DateTime('2000-01-01');
              
                $contact->email = (!$contactDetail['email'] === null) ? $contactDetail['email'] : 'null';;
                $contact->account = $contactDetail['account'];
                $contact->save();
                $sensitive_data = new Creditcard;
                $sensitive_data->type = $contactDetail['credit_card']['type'];
                $sensitive_data->number = $contactDetail['credit_card']['number'];
                $sensitive_data->name = $contactDetail['credit_card']['name'];
                $sensitive_data->expirationDate = $contactDetail['credit_card']['expirationDate'];
                $sensitive_data->save();
            }

Open in new window


Error when loading longer than a minute:




ASKER CERTIFIED SOLUTION
Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 14 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 14 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004