PHPackages                             skybluesofa/laravel-wrapped-facade - 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. skybluesofa/laravel-wrapped-facade

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

skybluesofa/laravel-wrapped-facade
==================================

Laravel facades with before/after method functionality

1.0.3(2y ago)05MITPHPPHP ^8.1

Since Jan 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/skybluesofa/Laravel-wrapped-facade)[ Packagist](https://packagist.org/packages/skybluesofa/laravel-wrapped-facade)[ RSS](/packages/skybluesofa-laravel-wrapped-facade/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Wrapped-Facade
======================

[](#laravel-wrapped-facade)

Add before- and after- method calls to Facades.

Purpose
-------

[](#purpose)

This library creates the ability to add pre- and post- methods when calling Facade methods. You can find an example in the `tests` folder.

It is most useful purpose that I have found is to cache information instead of running a request.

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

This package supports Laravel `v9` and `v10`

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

[](#installation)

```
composer require skybluesofa/laravel-wrapped-facade

```

Setup
-----

[](#setup)

### Install the Config File

[](#install-the-config-file)

#### Publish the Config File

[](#publish-the-config-file)

Run the artisan command to publish the package's config file:

```
php artisan vendor:publish --tag=wrapped-facade-config

```

*or*

#### Copy the Config File

[](#copy-the-config-file)

Copy the `wrapped-facade.php` file from the `vendor/skybluesofa/laravel-wrapped-facade/config` folder to your application's `config` folder.

Using Wrapped Facades
---------------------

[](#using-wrapped-facades)

Wrapped Facades work, out-of-the-box, exactly the same as standard (Laravel Facades)\[\].

### Basic Facade Functionality

[](#basic-facade-functionality)

Lets start with the base `Fruits` class:

```
