Skip to content

Commit

Permalink
Use facade since it cache the singleton and set the interface for ret…
Browse files Browse the repository at this point in the history
…urn type

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 21, 2019
1 parent 00ef239 commit fd564f7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Orchestra\Messages\MessageBag;
use Orchestra\Support\Facades\Messages;
use Orchestra\Contracts\Messages\MessageBag;

if (! \function_exists('messages')) {
/**
Expand All @@ -9,12 +10,10 @@
* @param string $key
* @param string|callable $message
*
* @return \Orchestra\Messages\MessageBag
* @return \Orchestra\Contracts\Messages\MessageBag
*/
function messages(string $key, $message): MessageBag
{
return \app('orchestra.messages')->add(
$key, \value($message)
);
return Messages::add($key, \value($message));
}
}

0 comments on commit fd564f7

Please sign in to comment.