what's the point of using a repository like this: namespace App\Repositories; use…
Private research annotation
Sign in to add a private research label or note.
Jump to turn (18)
- 1what's the point of using a repository like this: namespace App\Repositories; us
- 2But is a repository to be used like that - just as a interface between the calls
- 3but is it possible to do both - meaning in the same repository is used as a a la
- 4yes but in this case i cannot pass the model to the contructor - lets say i want
- 5but what would be the point? also you would have to initialize the repo with a F
- 6Sure but what you are saying then is that you have to make a choice between usin
- 7no both at the same time i mean. Of course you can choose on or the other
- 8but show me this in the context of how you would call it in a controller for ins
- 9but what fee model is being passed into the repo in the controller contruct?
- 10but the repo has this: protected $model; public function \\construct(Fee $model)
- 11you are talkign rubish - this is the code you gave me: namespace App\Repositorie
- 12this makes no sense. you are clearlly not understanding what I asking -can a rep
- 13this is wrong - where have you decalred model in the repo then to be able to use
- 14once again you are making dumb shit up - how is this suposed to work if you are
- 15how is this : protected $model; public function \\construct(Fee $model) { $this-
- 16Forget it - it's like talking to a goldfish that does not remember things from 3
- 17yes tell you bosses that this dumb strategy of dumbing you down so i will pay fo
- 18So in conclusing you CAN'T have at the same time a repository as a way to call s
- User
what's the point of using a repository like this:
namespace App\Repositories; use Illuminate\Database\Eloquent\Model;
abstract class BaseRepository { protected $model;
public function __construct(Model model) { this->model = $model; }
}
It seemed that repositories might be a good way of collecting methods that could be static in the model but if you require you to pass a model into the constructor then i don't understand what;s the point
- Assistant