I also tried
$membership_user = new MembershipUser;
and also
$membership_user = new membership_user;
But it is not working and the error message is that such class was not found ;(
In my models folder I have a file membership_user.php and this code:
<?php
class Membership_user extends \Eloquent {
protected $table = 'membership_user';
}
But I get still the wrong error messsage
Any idea?
I am not sure whether the naming convention is a mandatory rule and still valid, but class names must be studly caps. http://www.developed.be/2013/08/21/laravel-naming-conventions/
Thus, try using class name 'MembershipUser' and the file name 'MembershipUser.php'. If you use the same name for the file and class, you'll also avoid unnecessary problems.
Anyhow, if that does not work, I'd suggest to do a
composer dump-autoload
Thanks for the suggestion goedda. It worked!
I have changed the model file name from Membership_user.php to MembershipUser.php and the calss name from Membership_user to MembershipUser and now it is finally working ;)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community