Last active
December 30, 2015 01:59
-
-
Save mewm/7759143 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#On top of routes (got it in a service provider, but put it here because I have to debug) | |
App::bind('\Mewm\Shop\Storage\Category\CategoryRepository', function($app) { | |
return new \Mewm\Shop\Storage\Category\CategoryEloquent(); | |
}); | |
...... | |
#CategoryEloquent looks like this | |
namespace Mewm\Shop\Storage\Category; | |
class CategoryEloquent implements CategoryRepository { | |
protected $category; | |
public function __construct() | |
{ | |
$this->category = new \ShopCategory(); //A regular model | |
} | |
.... | |
#I get this | |
Target [Mewm\Shop\Storage\Category\CategoryRepository] is not instantiable. | |
.... | |
#I try instantiate it from the my controller | |
class CategoryController extends BaseController { | |
protected $category; | |
public function __construct(\Mewm\Shop\Storage\Category\CategoryRepository $category) | |
{ | |
$this->category = $category; | |
} | |
...... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment