PHPackages                             alvarofpp/expand-request - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. alvarofpp/expand-request

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

alvarofpp/expand-request
========================

A package to make it easy to manipulate your requests and more

1.1.1(5y ago)3350MITPHPPHP &gt;=7.2.0

Since May 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/alvarofpp/laravel-expand-request)[ Packagist](https://packagist.org/packages/alvarofpp/expand-request)[ Docs](https://github.com/alvarofpp/laravel-expand-request)[ RSS](/packages/alvarofpp-expand-request/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

expand-request
==============

[](#expand-request)

[![Packagist Version](https://camo.githubusercontent.com/4d2b99782cbeeff68c39030d01789cfcb75ba3240d34e929484c7200befc22c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c7661726f6670702f657870616e642d72657175657374)](https://packagist.org/packages/alvarofpp/expand-request)[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://github.com/alvarofpp/laravel-expand-request/blob/master/LICENSE)

A package to make it easy to manipulate your requests and more.

Contents
--------

[](#contents)

- [Install](#install)
- [Usage](#usage)
- [Contributing](#contributing)

Install
-------

[](#install)

Install via composer:

```
composer require alvarofpp/expand-request
```

Usage
-----

[](#usage)

This package currently contains:

- Checks whether the request url belongs to a pattern.
- Add url parameters to be validated.
    - Rename url parameters.
- Remove extra parameters.

### Checks whether the current request url belongs to a pattern

[](#checks-whether-the-current-request-url-belongs-to-a-pattern)

You can check whether the request url belongs to a url pattern or route pattern. Use this methods:

- `is_url($patterns, $request = null)`
- `is_route($patterns, $request = null)`

By default, `$request` is the current request.

Example: You can use this to activate a class in your menu, such as:

```

        Show courses

```

These methods accept a array as the first parameter, so that you can check various patterns:

```

        Show courses

```

Another example is that you can use it to check where the user is coming from:

```
