Search
 
SCRIPT & CODE EXAMPLE
 

PHP

make a global php function in laravel so that accessed anywhere

function your_function( $parameters ) {
    //function logic
} 

function your_another_function( $parameters ) {
    //function logic
} 

// composer.json
"autoload": {
    ...
    "files": [
        "app/Helpers/your_helper_function.php"
    ]
    ...
}

// Now call from any class of Laravel
class UserController extends Controller {
   
  public function storeUser() {
  	your_function();
    
    // do other stuffs
  }

}
Comment

PREVIOUS NEXT
Code Example
Php :: php?gs=3 
Php :: wordpress widget categories edit 
Php :: acf advanced link 
Php :: do php 
Php :: joomla k2 api 
Php :: php limit results by 30 days 
Php :: sorting table row data with php 
Php :: Differentiate PHP include and require statement 
Php :: Laravel Exclude URI from csrf token verification 
Php :: Find template serving current page 
Php :: md5_file (PHP 4 = 4.2.0, PHP 5, PHP 7, PHP 8) md5_file — Calculates the md5 hash of a given file 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 7.4.0". 
Php :: if no data show msg and chang style laravel 
Php :: Best Image Manipulation and Graphs tools for php 
Php :: php file structure 
Php :: ReflectionException: Class "MagentoFrameworkAppHttpInterceptor" does not exist in /bitnami/magento/vendor/magento/framework/Code/Reader/ClassReader.php:34 
Php :: controller run 
Php :: opencart set page title config php 
Php :: getIP php 
Php :: gd2 image resizing library in codeigniter 
Php :: laravel make model controller migration -mcr 
Php :: $SERVER get cuurent directior PHP 
Php :: laravel orm tutorial 
Php :: hide in nova laravel 
Php :: laravel get referer without host 
Php :: numberformatter gujarati 
Php :: symfony request 
Php :: php calling abstract static function from inside abstrac class 
Php :: how to rrestart brew php 
Php :: laravel asset resolving to http not https 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =