How create own class helper in Laravel? -


i need create own class methods, want call diverse controllers.

what should be: library, provider or helper in laravel?

1: create folder app/helpers
2: in app/providers create new provider file helperserviceprovider.php
3: in file register helpers classes need

$this->app->bind('datehelper', function() {     return new \app\helpers\datehelper; }); ... etc 

4: in config/app.php add new provider

'app\providers\helperserviceprovider',  

5: need create facade available use helper in view. find info how create facade on official laravel.com site


providers, can read doc
source: laravel forums


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -