Helper problems in Laravel 5.6

Asked

Viewed 86 times

0

I created a PHP page and made some functions in it to help my project.

I added in commiserate that page across that line:

"files": ["App/FunAuxiliar.php"]

But when I went up the system for production, I couldn’t call the functions I created for this page.

Someone has a solution?

  • What is the operating system of your Production server?

  • Is the server linux? Remember that it is case sensitive and if Voce is searching with minuscula will not find

1 answer

2


Probably the problem is you’re using App\FunAuxiliar.php, instead of app\FunAuxiliar.php.

To my knowledge, in Laravel, the default application folder is app and not App.

On operating systems like Windows, it makes no difference. But on Linux it does, since Linux is case-sensitive (case-sensitive).

This problem often happens when you program your application on Windows and move it up to a Linux server.

Therefore, the recommendation is always to reference the actual folders as their value is, and not to change a case (upper or lower case) of a letter of the directory name, as you did.

  • Thanks for the answer, but my problem is that I changed this file in Composer.json, and there is no such file on my server, I don’t know if I should pass it to the server and if so, if I should just copy it.

  • @Andrétripodecolognesi as well? If you need the functions, you need the file.

  • @Andrétripodecolognesi copies the file to the server then :)

  • So dude, on my server there’s no file. json, I copied it and it hasn’t changed a bit, I don’t know what to do, but thank you.

  • @Andrétripodecolognesi but . json is only to generate autoload.php, you do not need to send it, send the vendor folder and it is solved, or not?

  • @Andrétripodecolognesi you are mistaken. The composer.json by itself does nothing. You must put app as a minuscule in Poser.json, and in the local project, run composer dump -o. After doing this, send the folder vendor to the server again (I am assuming you are using FTP)

  • I am using SFTP, I sent the COMPOSER folder to the server and my system stopped, now I am sent to VENDOR, thanks for the help.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.