1. Go to this page and download the library: Download jdw5/surge-toast library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jdw5 / surge-toast example snippets
public function share (Requesr $request): array
{
return [
...parent::share($request),
'toast' => $request->session()->get('toast')
]
}
public function __construct(
public string $message,
public ?string $type = ToastType::DEFAULT->value,
public ?int $duration = self::DEFAULT_DURATION,
public ?string $title,
public ?mixed $custom,
) {}