HEX
Server: Apache
System: Linux webm013.cluster123.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: lesanew (165608)
PHP: 8.3.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/lesanew/anestetues2/vendor/roots/acorn/src/Roots/Acorn/View/Composers/Concerns/AcfFields.php
<?php

namespace Roots\Acorn\View\Composers\Concerns;

use Illuminate\Support\Fluent;
use Illuminate\Support\Str;

trait AcfFields
{
    /**
     * ACF data to be passed to the view before rendering.
     *
     * @param  int  $postId
     * @return array
     */
    protected function fields($postId = null)
    {
        return collect(\get_fields($postId))
            ->mapWithKeys(function ($value, $key) {
                $value = is_array($value) ? new Fluent($value) : $value;
                $method = Str::camel($key);

                return [$key => method_exists($this, $method) ? $this->{$method}($value) : $value];
            })->all();
    }
}