PHP 8.3.31
Preview: CompilesStacks.php Size: 2.73 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesStacks.php

<?php

namespace Illuminate\View\Compilers\Concerns;

use Illuminate\Support\Str;

trait CompilesStacks
{
    /**
     * Compile the stack statements into the content.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compileStack($expression)
    {
        return "<?php echo \$__env->yieldPushContent{$expression}; ?>";
    }

    /**
     * Compile the push statements into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compilePush($expression)
    {
        return "<?php \$__env->startPush{$expression}; ?>";
    }

    /**
     * Compile the push-once statements into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compilePushOnce($expression)
    {
        $parts = explode(',', $this->stripParentheses($expression), 2);

        [$stack, $id] = [$parts[0], $parts[1] ?? ''];

        $id = trim($id) ?: "'".(string) Str::uuid()."'";

        return '<?php if (! $__env->hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.');
$__env->startPush('.$stack.'); ?>';
    }

    /**
     * Compile the end-push statements into valid PHP.
     *
     * @return string
     */
    protected function compileEndpush()
    {
        return '<?php $__env->stopPush(); ?>';
    }

    /**
     * Compile the end-push-once statements into valid PHP.
     *
     * @return string
     */
    protected function compileEndpushOnce()
    {
        return '<?php $__env->stopPush(); endif; ?>';
    }

    /**
     * Compile the prepend statements into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compilePrepend($expression)
    {
        return "<?php \$__env->startPrepend{$expression}; ?>";
    }

    /**
     * Compile the prepend-once statements into valid PHP.
     *
     * @param  string  $expression
     * @return string
     */
    protected function compilePrependOnce($expression)
    {
        $parts = explode(',', $this->stripParentheses($expression), 2);

        [$stack, $id] = [$parts[0], $parts[1] ?? ''];

        $id = trim($id) ?: "'".(string) Str::uuid()."'";

        return '<?php if (! $__env->hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.');
$__env->startPrepend('.$stack.'); ?>';
    }

    /**
     * Compile the end-prepend statements into valid PHP.
     *
     * @return string
     */
    protected function compileEndprepend()
    {
        return '<?php $__env->stopPrepend(); ?>';
    }

    /**
     * Compile the end-prepend-once statements into valid PHP.
     *
     * @return string
     */
    protected function compileEndprependOnce()
    {
        return '<?php $__env->stopPrepend(); endif; ?>';
    }
}

Directory Contents

Dirs: 0 × Files: 21

Name Size Perms Modified Actions
2.44 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
446 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
413 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
6.46 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
9.27 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
4.52 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
933 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
729 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
1.56 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
2.38 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
505 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
447 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
725 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
3.01 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
4.82 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
620 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
1013 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
2.73 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
443 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
1.03 KB lrw-rw-rw- 2025-09-17 06:52:56
Edit Download
532 B lrw-rw-rw- 2025-09-17 06:52:56
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).