PHP 8.3.31
Preview: InteractsWithSession.php Size: 1.12 KB
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php

<?php

namespace Illuminate\Foundation\Testing\Concerns;

trait InteractsWithSession
{
    /**
     * Set the session to the given array.
     *
     * @param  array  $data
     * @return $this
     */
    public function withSession(array $data)
    {
        $this->session($data);

        return $this;
    }

    /**
     * Set the session to the given array.
     *
     * @param  array  $data
     * @return $this
     */
    public function session(array $data)
    {
        $this->startSession();

        foreach ($data as $key => $value) {
            $this->app['session']->put($key, $value);
        }

        return $this;
    }

    /**
     * Start the session for the application.
     *
     * @return $this
     */
    protected function startSession()
    {
        if (! $this->app['session']->isStarted()) {
            $this->app['session']->start();
        }

        return $this;
    }

    /**
     * Flush all of the current session data.
     *
     * @return $this
     */
    public function flushSession()
    {
        $this->startSession();

        $this->app['session']->flush();

        return $this;
    }
}

Directory Contents

Dirs: 0 × Files: 13

Name Size Perms Modified Actions
3.92 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
2.08 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
6.48 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
9.82 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
1.16 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
6.65 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
3.01 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
1.12 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
7.94 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
1.49 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
2.34 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
20.02 KB lrw-rw-rw- 2025-09-17 06:52:55
Edit Download
111 B lrw-rw-rw- 2025-09-17 06:52:55
Edit Download

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