-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a794ea9
commit 209360c
Showing
22 changed files
with
311 additions
and
60 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,25 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\News; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class NewsCreated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
public News $news; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param News $news | ||
*/ | ||
public function __construct(News $news) | ||
{ | ||
$this->news = $news; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\News; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class NewsDeleted | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
public News $news; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param News $news | ||
*/ | ||
public function __construct(News $news) | ||
{ | ||
$this->news = $news; | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\News; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class NewsUpdated | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
public News $news; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @param News $news | ||
*/ | ||
public function __construct(News $news) | ||
{ | ||
$this->news = $news; | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\Post; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class PostDeleted | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
public Post $post; | ||
|
||
public function __construct(Post $post) | ||
{ | ||
$this->post = $post; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
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
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
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,42 @@ | ||
<?php | ||
|
||
namespace App\Observers; | ||
|
||
use App\News; | ||
use Illuminate\Support\Facades\Cache; | ||
|
||
class NewsObserver | ||
{ | ||
/** | ||
* Handle the news "created" event. | ||
* | ||
* @param \App\News $news | ||
* @return void | ||
*/ | ||
public function created(News $news) | ||
{ | ||
Cache::tags(['news', 'latest_news', 'statistics_data', 'tags_cloud'])->flush(); | ||
} | ||
|
||
/** | ||
* Handle the news "updated" event. | ||
* | ||
* @param \App\News $news | ||
* @return void | ||
*/ | ||
public function updated(News $news) | ||
{ | ||
Cache::tags(['news', 'latest_news', 'statistics_data', 'tags_cloud'])->flush(); | ||
} | ||
|
||
/** | ||
* Handle the news "deleted" event. | ||
* | ||
* @param \App\News $news | ||
* @return void | ||
*/ | ||
public function deleted(News $news) | ||
{ | ||
Cache::tags(['news', 'latest_news', 'statistics_data', 'tags_cloud'])->flush(); | ||
} | ||
} |
Oops, something went wrong.