laravel-4.2


Where to write common function or logic in laravel 4.2


I want to use a common function or logic in all controllers on laravel4.2, what would be best way to do this? Does Anyone have any idea?
You can use Helper for that.
Create helpers.php in app folder.
You can create normal function there which you can use anywhere in laravel.
Example syntax for function :
function YOUR_FUNCTON_NAME(param1,param2) {
#YOUR_CODE
}
After creating helpers.php file , add it in app/start/global.php file.
like below :
require app_path().'/helpers.php';
And you can use anywhere in your controller like this YOUR_FUNCTON_NAME(param1,param2)
Hope this help.

Related Links

Itunes api call limit
how to solve update part error in laravel 4.2
How to delete a directory with its file from the public storage in laravel 4.2
Laravel 4.2 site doesn't work on localhost
send value from views in form of {{ FORM:: }} and recieve value in controller
how to count column(with data) number in laravel excel maatwebsite
Where to write common function or logic in laravel 4.2
post ajax jquery laravel 4 error 500
Undefine variable via post method in sending email from array using laravel 4.2
IronQueue sending jobs twice
Upload Log files to different server : Laravel
Url loading the login page again after login in Laravel4

Categories

HOME
rust
events
libgdx
lambda
typelite
twitter-fabric
header
share
u-boot
graphql-js
polymer-2.x
azure-logic-apps
swarm
graphdb
jquery-file-upload
google-awareness
sql-injection
squid
sonicwall
nest-api
opam
stackexchange.redis
eclipse-emf
restier
jstree
fusetools
python-appium
materialize
fusion
xenapp
mapnik
sca
gsp
grails-2.5
stackpanel
variable-variables
morphline
rightnow-crm
photoswipe
freshdesk
stateless-session-bean
dymola
sidewaffle
nclam
xcode8-beta4
apple-configurator
distributed-cache
enunciate
boost-proto
ibm-was
dnx50
netdatacontractserializer
supercomputers
replicaset
domino-designer-eclipse
scala-swing
sablecc
operands
nesper
object-code
loginview
otl
csslint
redpitaya
hyperloglog
iosched
principalcontext
spring-security-acl
visual-c++-2005
xsd2code
ax
proc-open
liveconnect
dip
ccl
mygeneration
odac
pinax
principles
data-retrieval
external-sorting
datagridcolumn
html-generation
jvm-bytecode

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App