I am trying to follow the repository pattern outlined in this article http://code.tutsplus.com/tutorials/the-repository-design-pattern--net-35804#highlighter_174798 And I am trying to instantiate a class in Laravel using App::make() (Which I am guessing is Laravel's factory pattern?) and I am trying to parse arguments to my class but I can't work out how to do it.
Code:
namespace My;
class NewClass {
function __construct($id, $title)
{
$this->id = $id;
$this->title = $title;
}
}
$classArgs = [
'id' => 1,
'title' => 'test',
]
$newClass = App::make('My\NewClass', $classArgs);
Can anyone point to an example of how to use App::make() or have I gone in the completely wrong direction and shouldn't be using App::make()?