PHP code example of lukebro / flash

1. Go to this page and download the library: Download lukebro/flash 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/ */

    

lukebro / flash example snippets


flash()->success('Signed in successfully.');

	'providers': [
			Lukebro\Flash\FlashServiceProvider::class,
	];

	'aliases' => [
	    'Flash' => Lukebro\Flash\FlashFacade::class
	];

flash()->warning('Max file size is 5MB.');

flash()->warning('Max file size is 5MB.')
	   ->warning('Username is 

@foreach (flash()->all() as $flash)
	<div class="alert alert-{{ $flash->level }}">{{ $flash->message }}</div>
@endforeach

@if (flash()->has('error'))
	<ul class="errors">
		@foreach (flash()->get('error') as $flash)
			<li>{{ $flash->message }}</li>
		@endforeach
	</ul>
@endif

flash()->again();

flash('error', 'There was an error processing your request.');

@if (flash()->exists())
	<div class="alert alert-{{ flash()->level }}">
		{{ flash()->message }}
	</div>
@endif

@if (flash()->exists())
	@foreach (flash()->all() as $flash)
		<div class="alert alert-{{ $flash->level }}">
			{{ $flash->message }}
		</div>
	@endforeach
@endif

@if (flash()->has('success'))
	<script>
		launchFireworks();
	</script>
@endif

@if (flash()->has('error'))
	<ul class="errors">
		@foreach (flash()->get('error') as $flash)
			<li>{{ $flash->message }}</li>
		@endforeach
	</ul>
@endif

[
	'flashes' => [
		['level' => '', 'message' => ],
		['level' => '', 'message' => ]
	]
]