PHPackages                             trabdlkarim/lararestler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. trabdlkarim/lararestler

ActiveLibrary[API Development](/categories/api)

trabdlkarim/lararestler
=======================

A package for having Restler API in your Laravel application.

v1.0.8(3mo ago)07MITJavaScriptPHP ^8.2

Since May 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/trabdlkarim/lararestler)[ Packagist](https://packagist.org/packages/trabdlkarim/lararestler)[ RSS](/packages/trabdlkarim-lararestler/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (14)Versions (5)Used By (0)

[![Lararestler](https://raw.githubusercontent.com/trabdlkarim/assets/main/lararestler/preview.png)](https://packagist.org/packages/trabdlkarim/lararestler)

[![Build Status](https://github.com/laravel/framework/workflows/tests/badge.svg)](https://github.com/laravel/framework/actions)[![Total Downloads](https://camo.githubusercontent.com/c6e172b59bdad7b5a7e27afc406a6c4000a1b65497f5fdc37a2b05083be55506/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74726162646c6b6172696d2f6c617261726573746c6572)](https://packagist.org/packages/trabdlkarim/lararestler)[![Latest Stable Version](https://camo.githubusercontent.com/27f96c692dfba851a5a48e4fd2beb4db994311c041f25ef3accef52180ac24a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74726162646c6b6172696d2f6c617261726573746c6572)](https://packagist.org/packages/trabdlkarim/lararestler)[![License](https://camo.githubusercontent.com/e47f1c61c7f0e0dc9648fce71a919bccca5779476f8589702611ef5217658d77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74726162646c6b6172696d2f6c617261726573746c6572)](https://packagist.org/packages/trabdlkarim/lararestler)

Restler for Laravel
-------------------

[](#restler-for-laravel)

Lararestler is a simple package that lets you to take advantage of all the features from both [Restler 5](https://restler5.luracast.com/) and Laravel as your API backend. With this package you can seamlessly integrate Restler into your existing laravel application without any hassle.

Installation
------------

[](#installation)

You can easily install this package with `conmposer`.

```
composer require trabdlkarim/lararestler
```

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:

```
php artisan vendor:publish --tag=lararestler-config --tag=lararestler-assets
```

The following files should be generated if everything works fine:

- `config/lararestler.php`
- `resources/views/vendor/lararestler/explorer.blade.php`
- `public/vendor/lararestler/*`

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

Usage
-----

[](#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

[](#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.

```
