The point that he makes there is that you can use view()->share() from within other methods and share data with the view that is being rendered instead of returning the data from one method and pass it into the view helper. So here is an example of both:
public function index()
{
$this->prepareData();
$anotherData = $this->otherData();
return view('index', compact('anotherData'));
}
// using view share
private function prepareData()
{
$data = Model::all();
view()->share('data', $data);
}
private function otherData()
{
return Model::all();
}
So both $data and $anotherData will be available in the index.blade.php. Using share is good, but it is a bit of magical, and you need to be comfortable with Laravel and know what you do to not get confused by it. The same goes with using View Composers. Those are good for hiding the logic and prepare the data, but you might get lost if you don't know what you are doing, especially for new comers.
