Public static usage in Laravel
1 2 3 4 5 6 7 8 9 10 11 12 |
If we are not using the public static keyword in the model.below error. For example you will get if you trying to access getempEmail() model function from the Myinputcontroller. ErrorException in Myinputcontroller.php line 34: Non-static method App\Models\emprManagement::getempEmail() should not be called statically, assuming $this from incompatible context inorder to avoid this error please use the function in model as like below public static function getempEmail($user_id) { } |