make an abstract model BaseModel extending the laravel Model. then make your other models extend your BaseModel. define your protected attributes on the base model.
Thanks for your reply but I was questioning the design principle; I think you misunderstood the question.
A simple example just to illustrate the problem:
// When $perPage is static:
$perPage = Request::get('perPage', User::$perPage);
$users = User::paginate($perPage);
// Current ugly sitiuation:
$utilityModel = new User();
$perPage = Request::get('perPage', $utilityModel->getPerPage());
$users = User::paginate($perPage);
oh i see, imo it's more like user preference.. in this case i would go with ->getPerPage()
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community