Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

inheritx's avatar

Integrate core php library without any class

Hi,

I have been trying to integrate a Movie Masher api library with laravel. The library is built with core php and xml files. The php code doesn't involve any OOPS concepts in it. I have been trying to integrate it with laravel for days now but still I haven't succeeded in it. Now i am starting to wonder whether it is possible or not to integrate it with laravel.

How can i integrate such library with laravel?

Anyone, if has a solution for the same than please help me out.

Thanks in advance

0 likes
9 replies
bart's avatar

You can put the library under something like /libs and then add it to your composer.json under autoload classmap. You should then have access to that 3rd part library.

inheritx's avatar

I did try that but it gives me routing collection error. Please take a note that the library doesn't have a class structure.

milon's avatar

in that case add your file names to "files" array in composer.json file. you are good to go.

inheritx's avatar

@milon:- Can i access those files through url after adding file names in composer.json files?

bart's avatar

What do you mean by "accessing these files by url"? When you put them into public you can, but you shouldn't do that. What for? As you said they are just libraries?!

inheritx's avatar

Still no luck with the error. And by accessing through URL i meant that if a file contains some HTML form than i should be able to display that form. Also there are many files being included in a single file so do i need to add all that files in composer.json or by adding the file that includes other file will work ?

Please or to participate in this conversation.