I'm new to Laravel. I created a Controller-function that reads an xml file in my public (/xml) folder and searches it for a node with a specific id-attribute.
public function show_word($id)
{
$xml_path = asset('xml/words.xml');
$xml_sim = simplexml_load_file($xml_path);
$word_existing = $xml_sim->xpath("//word[@id=" . $id . "]");
return view('glossarium.vocab_morph', compact('word_existing'));
}
However, when I call the Route with the ID, I get a timeout-error (Maximum execution time of 60 seconds exceeded). My checklist:
Can you help me out?
It seems like I used the wrong helper-function. I moved my xml to the laravel resources folder and access the path with the function
$path = resource_path('xml/words.xml');
Thanks nonetheless for your help!