Laravel is namespaced, so you must use "\Exception":
try{
// try code
}
catch(\Exception $e){
// catch code
}
zegarr liked this reply
youndivian said:
Laravel is namespaced, so you must use "\Exception":
try{ // try code } catch(\Exception $e){ // catch code }
Thanks buddy! this saved me a lot of time
youndivian said:
Laravel is namespaced, so you must use "\Exception":
try{ // try code } catch(\Exception $e){ // catch code }
Same here man, saved me a lot of time, thanks.
youndivian said:
Laravel is namespaced, so you must use "\Exception":
catch(\Exception $e){ // catch code }
tanks. its work. but for what?
(\Exception
and no
(Exception
:/
mortezaataiy said:
youndivian said:
Laravel is namespaced, so you must use "\Exception":
catch(\Exception $e){ // catch code }
tanks. its work. but for what?
(\Exception
and no
(Exception
:/
You have to import Exception class and there are two ways of using class on Laravel Controller,
1). Either on the top you can write Use Exception; 2). or you can directly use exception class by \Exception
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community