Skip to content

Commit

Permalink
Style guide stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyWay committed Jul 11, 2016
1 parent 600a814 commit 03eec81
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 29 deletions.
11 changes: 6 additions & 5 deletions src/Laracasts/Flash/Flash.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php namespace Laracasts\Flash;
<?php

use Illuminate\Support\Facades\Facade;
namespace Laracasts\Flash;

class Flash extends Facade {
use Illuminate\Support\Facades\Facade;

class Flash extends Facade
{
/**
* Get the binding in the IoC container
*
Expand All @@ -13,5 +15,4 @@ protected static function getFacadeAccessor()
{
return 'flash';
}

}
}
9 changes: 5 additions & 4 deletions src/Laracasts/Flash/FlashNotifier.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php namespace Laracasts\Flash;
<?php

namespace Laracasts\Flash;

class FlashNotifier
{

/**
* The session writer.
*
Expand All @@ -23,7 +24,7 @@ function __construct(SessionStore $session)
/**
* Flash an information message.
*
* @param string $message
* @param string $message
* @return $this
*/
public function info($message)
Expand Down Expand Up @@ -116,5 +117,5 @@ public function important()

return $this;
}

}

5 changes: 3 additions & 2 deletions src/Laracasts/Flash/FlashServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php namespace Laracasts\Flash;
<?php

namespace Laracasts\Flash;

use Illuminate\Support\ServiceProvider;

class FlashServiceProvider extends ServiceProvider
{

/**
* Indicates if loading of the provider is deferred.
*
Expand Down
17 changes: 10 additions & 7 deletions src/Laracasts/Flash/LaravelSessionStore.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<?php namespace Laracasts\Flash;
<?php

use Illuminate\Session\Store;
namespace Laracasts\Flash;

class LaravelSessionStore implements SessionStore {
use Illuminate\Session\Store;

class LaravelSessionStore implements SessionStore
{
/**
* @var Store
*/
private $session;

/**
* Create a new session store instance.
*
* @param Store $session
*/
function __construct(Store $session)
Expand All @@ -20,12 +24,11 @@ function __construct(Store $session)
/**
* Flash a message to the session.
*
* @param $name
* @param $data
* @param string $name
* @param array $data
*/
public function flash($name, $data)
{
$this->session->flash($name, $data);
}

}
}
13 changes: 7 additions & 6 deletions src/Laracasts/Flash/SessionStore.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php namespace Laracasts\Flash;
<?php

interface SessionStore {
namespace Laracasts\Flash;

interface SessionStore
{
/**
* Flash a message to the session.
*
* @param $name
* @param $data
* @param string $name
* @param array $data
*/
public function flash($name, $data);

}
}
2 changes: 1 addition & 1 deletion src/Laracasts/Flash/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Arrange for a flash message.
*
* @param string|null $message
* @param string $level
* @param string $level
* @return \Laracasts\Flash\FlashNotifier
*/
function flash($message = null, $level = 'info')
Expand Down
15 changes: 11 additions & 4 deletions src/views/message.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
@if (session()->has('flash_notification.message'))
@if (session()->has('flash_notification.overlay'))
@include('flash::modal', [
'modalClass' => 'flash-modal',
'title' => session('flash_notification.title'),
'modalClass' => 'flash-modal',
'title' => session('flash_notification.title'),
'body' => session('flash_notification.message')
])
@else
<div class="alert alert-{{ session('flash_notification.level') }} {{ session()->has('flash_notification.important') ? 'alert-important' : '' }}">
<div class="alert
alert-{{ session('flash_notification.level') }}
{{ session()->has('flash_notification.important') ? 'alert-important' : '' }}"
>
@if(session()->has('flash_notification.important'))
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<button type="button"
class="close"
data-dismiss="alert"
aria-hidden="true"
>&times;</button>
@endif

{!! session('flash_notification.message') !!}
Expand Down

0 comments on commit 03eec81

Please sign in to comment.