Download the PHP package daniesy/rodels without Composer
On this page you can find all versions of the php package daniesy/rodels. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rodels
Rodels
Remote models for Laravel.
Getting Started
Follow these instructions to get Rodels up and running in your Laravel project.
Prerequisites
You need Composer installed on your machine, but since you're already using Laravel, I guess you can skip this step.
Installing
Begin by installing this package through Composer.
Laravel Users
For Laravel users, there is a service provider you can make use of to automatically register the necessary bindings.
Laravel 5.5+ users: this step may be skipped, as we can auto-register the package with the framework.
When this provider is booted, you'll gain access to a helpful Remote
facade, which you may use in your controllers.
In Laravel 5, of course add
use Remote;
to the top of your controller.
Defaults
If using Laravel, there are only two configuration options that you'll need to worry about. First, publish the default configuration
This will add a new configuration file to: config/rodels.php
.
Using the library.
We add two artisan commands, one will create endpoints and the other one rodels.
Endpoints
The first step when using Rodels is to create an endpoint.
This will create a new class in app\Endpoints
- in this case Users.php
.
In this class you should define all methods related to your endpoint.
All endpoints names should be nouns in plural form
Using the -r
or --rodel
option, automatically creates a rodel for this endpoint.
Rodels
For every endpoint, there should be a rodel created as well. Rodels are like Models, but instead of using them for databases, they're used for remote APIs.
Create a new rodel with this command:
This will create a new rodel class in app\Rodels
- in this case User.php
.
All rodels names should be nouns in singular form.