Trying to use the IoC as a factory. Can I pass data to initialize/construct object with?
App::bind('Song', function(){
return new Song;
});
and mimic this (can $data never gets passed along, why?)
App::bind('Song', function($data=null){
return new Song($data);
});
while the Class is
class Song extends Eloquent {
protected $fillable = array(
'id',
'name',
'type'
);
}
The App::make('Song',array('id'=>1,'name'=>'foo'))
call skips inserting my arguments inside Illuminate\Container - the initialized class does not contain any defined attributes.