The with
method requires two arguments, one for the name of the variable and ne for the value but you gave only one, it should be like this:
->with('parser', Parser::importFeed($id))
So you can use $parser
in your view
. Also in any scope
method it accepts the $query
at first argument and yo should return the $query
as well to allow method chaining, so it should be like this:
public function scopeImportFeed($query, $feed_id) {
$this->feed_id = $feed_id;
return $query;
}
So you may use:
Parser::importFeed($id)->get()
But, according to your code, nothing should get returned because you are not doing any query at all.