Roots Discourse

Sage - SoberWp Controller - {! App::title() !} in blade view is not working

blade
sage9

#21

Thanks so much for being so patient and your explanation. I decided to start over and found out that it was all my fault and that the problem is the deployment process. When I look at the Sage documentation for deployment it is not clear to me what needs to be copied via FTP to the server and what is not needed for the production site. Here’s my summary:

Do NOT copy via FTP to production server:

  • .cache-loader folder
  • node_modules folder
  • resources/assets folder
  • all files in the root folder (.editorconfig, .eslintrc.js, .gitignore, CHANGELOG.md, CODE_OF_CONDUCT.md, composer.json, composer.lock, LICENSE.md, package.json, package-lock.json, phpcs.xml, README.md, yarn.lock)

DO copy via FTP to production server:

  • app folder
  • config folder
  • dist folder
  • resources folder but not the resources/assets subfolder
  • vendor folder

This is what needs to be put in the deployment documentation or I suggest automating this process somehow via a new yarn command (for example yarn build:preparedeploy) which would create a new folder (for example deploy) and put all files that need to be copied via FTP to the production server in that folder. This is intended for people like me who deploy their website manually via FTP, use a shared hosting server, and can’t run composer install on the production server. What do you think?

This also fixes the problems with paths and using App::title() as there are no path issues if deployed properly.

I am not the first one who had a hard time - see How do you actually deploy the Sage theme to a Wordpress site?! - my summary should also be added to that topic thread but it’s already closed so I’ll leave that up to you. Ideally it should be in the documentation.


#22

Glad you were able to figure it out! If you have a contribution to the documentation, pull requests are always welcome: https://github.com/roots/docs


#23

Thank you for your help. Appreciate it. This can be closed now. Pull request for docs change is at https://github.com/roots/docs/pull/151


#24

I’d like to chime in with my own solution. I run Trellis + Bedrock + Sage.

Inside my Bedrock composer.json file (/website.com/site/composer.json) I had roots/sage as a dependency. I have no idea how this happened…

When my Sage theme went to check if the class Roots\Sage\Controller exists in functions.php before including it’s own composer auto loader it was already defined. I simply removed the dependency at the top level and everything worked.