Closed majweb closed 7 years ago
Hi there,
Try the following:
try {
foreach($user->connected_to_gyms as $key =>$man){
Mapper::location("$man->city $man->street $man->local")->map(['zoom' => 15, 'center' => true, 'marker' => true, 'type' => 'roadmap']);
}
} catch (\Exception $e) {
return view......
}
Its works!
tell me how pass variables with errors to blade and use if and else element?
You should be able to return your view, with an error key, for example:
return view(...)->withErrors(['This is an error message']);
Hi!
I use this package in laravel 5.4. In my controler i have: `try{ foreach($user->connected_to_gyms as $key =>$man){ Mapper::location("$man->city $man->street $man->local")->map(['zoom' => 15, 'center' => true, 'marker' => true, 'type' => 'roadmap']); } }catch(Exception $e){ return view...... }
@foreach($user->connected_to_gyms as $key =>$man)
I'cant catch exceptions what is wrong?