Skip to content

Commit

Permalink
[11.x] Add fluent helper (#50848)
Browse files Browse the repository at this point in the history
* Add fluent helper

* Update docblock

* formatting

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
PhiloNL and taylorotwell authored Apr 1, 2024
1 parent 4f6088b commit c215697
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\Arr;
use Illuminate\Support\Env;
use Illuminate\Support\Fluent;
use Illuminate\Support\HigherOrderTapProxy;
use Illuminate\Support\Once;
use Illuminate\Support\Onceable;
Expand Down Expand Up @@ -154,6 +155,19 @@ function filled($value)
}
}

if (! function_exists('fluent')) {
/**
* Create an Fluent object from the given value.
*
* @param object|array $value
* @return \Illuminate\Support\Fluent
*/
function fluent($value)
{
return new Fluent($value);
}
}

if (! function_exists('literal')) {
/**
* Return a new literal or anonymous object using named arguments.
Expand Down

0 comments on commit c215697

Please sign in to comment.