Skip to content

Commit

Permalink
Merge pull request #53 from digitlimit/52-fix-serialization-of-pdo-is…
Browse files Browse the repository at this point in the history
…-not-allowed

Fix Serialization of 'PDO' is not allowed
  • Loading branch information
digitlimit authored Sep 30, 2024
2 parents 2f0f795 + ba5fbbb commit 48cb414
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,39 @@

namespace Digitlimit\Alert;

use Illuminate\Session\Store;
use Illuminate\Support\Facades\Session as Store;

class Session implements SessionInterface
{
/**
* The store.
*/
private Store $store;

public function __construct(Store $store)
{
$this->store = $store;
}

/**
* Flash alert to store.
*/
public function flash(string $key, mixed $value): void
{
$this->store->flash($key, $value);
Store::flash($key, $value);
}

/**
* Put alert in the store.
*/
public function put(string $key, mixed $value): void
{
$this->store->put($key, $value);
Store::put($key, $value);
}

/**
* Remove alert from store.
*/
public function forget(string $key): void
{
$this->store->forget($key);
Store::forget($key);
}

/**
* Fetch alert from the store.
*/
public function get(string $key, mixed $default = null): mixed
{
return $this->store->get($key, $default);
return Store::get($key, $default);
}
}

0 comments on commit 48cb414

Please sign in to comment.