Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via composer

laravel/serializable-closure v1.3.3

Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
Package summary
Share
0
issues
1
license
1
MIT
Package created
8 Sep 2021
Version published
8 Nov 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
laravel/serializable-closure@v1.3.3
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of laravel/serializable-closure 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does laravel/serializable-closure do?

Laravel Serializable Closure is a potent and efficient tool used to serialize closures in PHP. This package is actually a fork of the popular opis/closure: 3.x package. Laravel forked this project to maintain usability with the 3.x series and support newer PHP versions even when the FFI extension is not enabled by default in web requests, a common environment for Laravel, a web framework.

How do you use laravel/serializable-closure?

Using Laravel Serializable Closure relies on initial installation via Composer, the PHP package manager. Utilize the following command for installing:

composer require laravel/serializable-closure

After completing the installation, you can serialize a closure in the following manner:

use Laravel\SerializableClosure\SerializableClosure;

$closure = fn () => 'james';

// It is recommended to set a secret key
SerializableClosure::setSecretKey('secret');

$serialized = serialize(new SerializableClosure($closure));
$closure = unserialize($serialized)->getClosure();

echo $closure(); // Outputs 'james'

Please note a few caveats; for instance, creating anonymous classes within closures and using attributes within closures are not supported. Similarly, serializing closures on REPL environments like Laravel Tinker or closures that refer to objects with read-only properties are not supported.

Where are the laravel/serializable-closure docs?

The documentation for Laravel Serializable Closure can be found on the Laravel website. Also, this package's readme file on GitHub (https://github.com/laravel/serializable-closure.git) offers essential usage guidelines. For contributions, the guide can be found in the Laravel documentation. Similarly, for ensuring security vulnerabilities, please review the security policy of the Laravel Serializable Closure on its GitHub page.