0

I'm following the tutorial here in the docs:

Custom Presenters

But where do I place the Zurb Presenter class in my file system and how do I let Laravel know it exists?

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
panthro
  • 22,779
  • 66
  • 183
  • 324

1 Answers1

0

There isn't really a defined place to put the actual file so you usually put it wherever feels the most natural to you. I'd probably create a presenters folder within your app folder and put it in there.

To let Laravel know where it is, there are a couple things you can do.

The first is adding it via composer. In your composer.json file, in the autoload classmap section, simply add your folder app/presenters. Then you will want to open up your command line, navigate to your project's directory, and run the command composer dump-autoload. Now it should automatically be loaded via composer.

The other solution would be to open up global.php in your app/start folder and add another entry in the ClassLoser::addDirectories() entry pointing to your new folder.

app_path().'/presenters',

user1669496
  • 32,176
  • 9
  • 73
  • 65