Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use without injection #58

Open
carlituxman opened this issue Nov 19, 2015 · 3 comments
Open

how to use without injection #58

carlituxman opened this issue Nov 19, 2015 · 3 comments

Comments

@carlituxman
Copy link

Hi, can I use doing this

$x = new App\Repositories\MyRepository

without injection at construct??

@petehouston
Copy link
Contributor

Yes, initialize your concrete implementation

class X {
   private $x = new App\Repositories\UserRepository;

  ...
}

@carlituxman
Copy link
Author

not work for me. Here error:
syntax error, unexpected 'new' (T_NEW)

if I use inside a function :
Argument 1 passed to Bosnadev\Repositories\Eloquent\Repository::__construct() must be an instance of Illuminate\Container\Container, none given, called in ...

@marwanzak
Copy link

marwanzak commented Sep 6, 2016

$repo = new \App\Repositories\AppRepository(app(), \Illuminate\Support\Collection::make());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants