PHPackages                             jamosaur/foundation - 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. jamosaur/foundation

ActiveLibrary[API Development](/categories/api)

jamosaur/foundation
===================

Foundation for API's in Laravel

1.0.1(1mo ago)03.1k↑88.2%PHPPHP ^8.2CI passing

Since Sep 30Pushed 1mo ago1 watchersCompare

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

READMEChangelogDependencies (16)Versions (17)Used By (0)

Foundation
==========

[](#foundation)

---

### What is this?

[](#what-is-this)

This is the base that I like to use for constructing API's with Laravel.

It is essentially a wrapper for Spatie's laravel-fractal.

---

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

[](#installation)

---

1. `composer require jamosaur/foundation`
2. Update your API controllers to extend `Jamosaur\Foundation\ApiController`. This extends the default Laravel controller but also adds more methods that we will use.
3. Update your API middleware in `app\Http\Kernel.php` to use `Jamosaur\Foundation\Middleware\ApiRequestMiddleware`

---

Example Usage
-------------

[](#example-usage)

### Controller

[](#controller)

```
