0 Best Reply Awards

  • Member Since 5 Months Ago
  • 193 Lessons Completed
  • 1 Favorite

7th May, 2018

guilhermemuller left a reply on Override Data In View Composer In Controller • 4 months ago

I ended up with a similar solution. I created a GlobalViewComposer that is called, then I define default values and override them with the existing data from the Controller:

public function compose(View $view)
        // defaults
        $var = null;

        // extract existing data to override defaults
    // if $var exists in view data, it will override the above $var
        $existingData = $view->getData();

        $view->with('var', $var);

That way I define default page meta (title, description, body tag class) and I can override in the Controller. Hope it helps.

25th April, 2018

guilhermemuller left a reply on Deploying A Laravel Application To DreamHost Shared Hosting • 4 months ago

Thank you, information like this is always useful.

Edit Your Profile

Want to change your profile photo? We pull from