Download the PHP package trabdlkarim/lararestler without Composer

On this page you can find all versions of the php package trabdlkarim/lararestler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lararestler

Lararestler

Build Status Total Downloads Latest Stable Version License

Restler for Laravel

Lararestler is a simple package that lets you to take advantage of all the features from both Restler 5 and Laravel as your API backend. With this package you can seamlessly integrate Restler into your existing laravel application without any hassle.

Installation

You can easily install this package with conmposer.

[!WARNING] You should note that this package works actually with Laravel framework ^12.x.

After the installation, you must publish the package assets for customization. Run the following command:

The following files should be generated if everything works fine:

Now, feel free to change or modifiy any of these files as needed, to adapt them to your project.

Usage

Before starting writting your API, make sure you've properly set the API resource namespace in config/lararestler.php. The default namespace is App\Http\Resources.

Add Resources to API

Create a new class and extend Mirak\Lararestler\Http\Resources\Resource class. Add all the needed private and public methods as you would do with Restler.

Let's define a basic API class called Users as an example.

Note that we make use of Mirak\Lararestler\Attributes\QueryParam contextual attribute to caputure relevant query parameters from the current request.

There is also another attribute Mirak\Lararestler\Attributes\RequestBody, useful when you want to capture all request body as an array.

Afterwards, you need to add your newly created resource class to the API resources array in config/lararestler.php file as shown below.

That's it, you're done! Visit the Explorer at {APP_URL}/api/explorer to play with the API.

Request Models

Your request models should extend Mirak\Lararestler\Http\Requests\Model class as follows:

Then, you could inject them into your resource class methods and use them as an instance of Laravel Illuminate\Http\Request class. Check the example below.

Protected API Routes

To protect a route in your resource class, simply add the @middleware annotation, followed by the name of the middleware, to the method documentation.

Contributing

Thank you for considering contributing to this package! You should take a look at the contribution guide here.

Code of Conduct

In order to ensure that the Lararestler community is welcoming to all, please review and abide by the Code of Conduct.

Security

If you discover a security vulnerability within this package, please send me an e-mail via [email protected]. All security vulnerabilities will be promptly addressed.

License

This is an open-sourced software licensed under the MIT license.


All versions of lararestler with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.14
illuminate/http Version ^12.14
illuminate/support Version ^12.14
illuminate/validation Version ^12.14
restler/framework Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package trabdlkarim/lararestler contains the following files

Loading the files please wait ....