Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
Where to put custom/new class file in Laravel?

I have PHP example on how to use Yelp Fusion API. It uses OAuth.php file with several classes. In main example it is imported with

require_once('lib/OAuth.php');

Can I do the same in Laravel?

Or I'd better provide namespace for OAuth.php file and put it somewhere on the tree? Where to put it?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I suggest your to make a new directory inside app and call it like "Classes" and store your OAuth.php as "/app/Classes/OAuth.php". Don't forget to put a namespace App\Classes; to top of this file.

Due to having several classes inside your file I suggest to rewrite this a bit and separate each class to file

about 4 years ago · Santiago Trujillo Report

0

You can use Yelp Fusion API with any other OAuth implementation. Here are OAuth packages for composer: https://packagist.org/search/?q=oauth

Using packages instead of custom PHP files would help to keep project clean.

If you still need to add any custom PHP files just create a directory within /app like "Libraries" or "Helpers" or what fits better to your content.

Directories and files within /app directory loaded automatically by Composer.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!