How to use an . php extension file in an Laravel form?

Asked

Viewed 227 times

0

I have a file .php which was developed in php pure and need to use it in Laravel.

For that I need to call him directly from action of a form, but the application is being developed in Laravel.

How is it possible to use this file without using the Laravel?

  • Just play inside the folder public/ and then point at the action as if the public were "root"

  • 1

    Dear, what this file .php pure makes? you have how to make this file available php pure? Don’t put anything in the `public folder that features security failure, because, the file will get exposed and unrestricted to all ...

1 answer

0


The ideal would be to use the routes of the Laravel to do this, otherwise it would not make sense to use a framework that provides you several resources if you do not want to use these resources.

You do the following:

Create a controller in your application and put your php script in a method of that controller, create a route and point to that method. Or if you prefer you can play the direct code in an anonymous function in the route file.

So in the action of your form you can point to that route.

  • But for example I need to import a class made in pure php to generate a full number as I do?

Browser other questions tagged

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