GithubHelp home page GithubHelp logo

Comments (1)

llagerlof avatar llagerlof commented on May 25, 2024

Hi Stephen!

I just made a test using Laravel 8 and the framework autoloaded the class correctly.

My steps:

  • I installed the latest Laravel.
composer create-project laravel/laravel laravel-autoload
  • Inside the laravel-autoload directory I ran:
composer require llagerlof/moodlerest

Tha package was added into composer.json and composer.lock correctly.

  • I opened the web.php and instantiated the class inside the default route:
Route::get('/', function () {
    $MoodleRest = new MoodleRest('http://127.0.0.1/moodle/webservice/rest/server.php', '8f12e614dae30735260a045313caa400');
    dd($MoodleRest);
    return view('welcome');
});

And it worked.

Did you ran composer dump-autoload inside your Laravel project? Sometimes this is necessary to Laravel find the new packages to autoload them.

And about the namespace, the reason I am avoiding it is because this class is aready being used by some people, and I don't want to disrupt something in their projects.

from moodlerest.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.