PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 8, 2022

[FIXED] Getting undefined function public_path() error in lumen

 March 08, 2022     laravel, lumen     No comments   

Issue

I am trying to upload image in lumen. I got some examples and when i tried to implement it, got below error <!-- Call to undefined function App\Http\Controllers\public_path() (500 Internal Server Error) -->

Just want to confirm is this function got changed or do i need to include helper file.

Thanks


Solution

Many of Laravel helpers doesn't exist in Lumen including public_path() and storage_path() you can include both methods in your Lumen project by creating a helpers.php file in your App directory or wherever you want and autoload that file in your composer.json files like so

"autoload": {
   "files": [
      "app/helpers.php"
   ],
   ....
  }
},


Answered By - mmabdelgawad
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing