PHPackages                             hotash/laravel-auto-compose - 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. [Templating &amp; Views](/categories/templating)
4. /
5. hotash/laravel-auto-compose

ActiveLibrary[Templating &amp; Views](/categories/templating)

hotash/laravel-auto-compose
===========================

A PHP Package To Automatically Compose Route Parameters To Appropriate View In Laravel.

1.0.1(5y ago)035MITPHPPHP &gt;=7.2.5

Since Feb 8Pushed 4y agoCompare

[ Source](https://github.com/bdsumon4u/laravel-auto-compose)[ Packagist](https://packagist.org/packages/hotash/laravel-auto-compose)[ Docs](https://github.com/bdsumon4u/laravel-auto-compose)[ RSS](/packages/hotash-laravel-auto-compose/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Laravel Auto Compose
====================

[](#laravel-auto-compose)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8d010051f52f5409e85bdd72fad016e756871984e63d681564756163d26747d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686f746173682f6c61726176656c2d6175746f2d636f6d706f73652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hotash/laravel-auto-compose)[![Total Downloads](https://camo.githubusercontent.com/e0b62d0abb0f76fd50f3d41014fa1c20fde0ae0703d58d69f6f6de161d82be1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686f746173682f6c61726176656c2d6175746f2d636f6d706f73652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hotash/laravel-auto-compose)

A PHP Package To Automatically Compose Route Parameters To Appropriate View In Laravel.

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

[](#installation)

You can install the package via composer:

```
composer require hotash/laravel-auto-compose
```

Usage
-----

[](#usage)

Nothing to do, just use your route parameters in your views. Don't need to pass the parameters from controller to view unless you modify the parameters in the controller.

```
namespace App\Http\Controllers;

use App\Models\Product;
use Illuminate\Http\Request;

class ProductController extends Controller
{
    /**
     * Display the specified resource.
     *
     * @param  \App\Models\Product  $product
     * @return \Illuminate\Http\Response
     */
    public function show(Product $product)
    {
        // Don't need to pass $product to the view.
        return view('products.show');
    }
}
```

All route parameters will be automatically passed to the view by the `laravel-auto-compose` Package.

Details
-------

[](#details)

If you modify a route parameter but don't pass it to the view from the controller, you'll lose the modification.

```
namespace App\Http\Controllers;

use App\Models\Product;
use Illuminate\Http\Request;

class ProductController extends Controller
{
    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $product = Product::with('categories')
            ->withTrashed()
            ->findOrFail($id);

        // Updating $id variable.
        $id = 'laravel-auto-compose';

        return view('products.show');
    }
}
```

In the example above, we haven't passed `$product` to our view. So, it wil not be available in the view. Now, what about `$id`? Well, the change of `$id` variable in the controller will not affect the `$id` variable in the view.
*In order to have the modification in our view, we must pass the `$id` variable from the controller to our view.*

#### Another Nice Example

[](#another-nice-example)

```
namespace App\Http\Controllers;

use App\Models\Product;
use Illuminate\Http\Request;

class ProductController extends Controller
{
    /**
     * Display the specified resource.
     *
     * @param  \App\Models\Product  $product
     * @return \Illuminate\Http\Response
     */
    public function show(Product $product)
    {
        $product = $product->load('categories');
        return view('products.show');
    }
}
```

We've loaded a relationship and updated `$product` variable.

#### *Is the relationship loaded on view?*

[](#is-the-relationship-loaded-on-view)

#### Yes, it is. *But why?*

[](#yes-it-is-but-why)

#### You're an Artisan, I'm leaving it upto you.

[](#youre-an-artisan-im-leaving-it-upto-you)

Request
-------

[](#request)

> **Please consider giving a star.**

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Sumon Ahmed](https://github.com/bdsumon4u)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

1966d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/75123992?v=4)[Sumon Ahmed](/maintainers/bdsumon4u)[@bdsumon4u](https://github.com/bdsumon4u)

---

Top Contributors

[![bdsumon4u](https://avatars.githubusercontent.com/u/75123992?v=4)](https://github.com/bdsumon4u "bdsumon4u (8 commits)")

---

Tags

hotashlaravel-auto-compose

### Embed Badge

![Health badge](/badges/hotash-laravel-auto-compose/health.svg)

```
[![Health](https://phpackages.com/badges/hotash-laravel-auto-compose/health.svg)](https://phpackages.com/packages/hotash-laravel-auto-compose)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[hasinhayder/tyro-dashboard

Tyro Dashboard - Beautiful admin dashboard for managing Tyro roles, privileges, users, and settings

5443.8k](/packages/hasinhayder-tyro-dashboard)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
