Answers for "make a global php function in laravel so that accessed anywhere"

PHP
0

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
  }

}
Posted by: Guest on July-10-2021

Code answers related to "make a global php function in laravel so that accessed anywhere"

Browse Popular Code Answers by Language