-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feed helper method and feed facade
- Loading branch information
1 parent
019d6c4
commit 56f309f
Showing
4 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Michaeljennings\Feed\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
class Feed extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'michaeljennings.feed'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
if ( ! function_exists('feed')) { | ||
|
||
/** | ||
* Get the notifications for the notifiable members. | ||
* | ||
* If no notifiable members are passed then return the feed instance. | ||
* | ||
* @param null $notifiable | ||
* @return \Illuminate\Foundation\Application|mixed | ||
*/ | ||
function feed($notifiable = null) | ||
{ | ||
$feed = app('michaeljennings.feed'); | ||
|
||
if ($notifiable) { | ||
return $feed->pull($notifiable); | ||
} | ||
|
||
return $feed; | ||
} | ||
|
||
} |