phpcollective /
menumaker
| 1 | <?php |
||
| 2 | |||
| 3 | namespace PhpCollective\MenuMaker\Jobs; |
||
| 4 | |||
| 5 | use Cache; |
||
| 6 | use Illuminate\Bus\Queueable; |
||
| 7 | use Illuminate\Queue\SerializesModels; |
||
| 8 | use Illuminate\Queue\InteractsWithQueue; |
||
| 9 | use PhpCollective\MenuMaker\Storage\Menu; |
||
| 10 | use Illuminate\Foundation\Bus\Dispatchable; |
||
| 11 | use Illuminate\Contracts\Queue\ShouldQueue; |
||
| 12 | |||
| 13 | class RemoveUserMenuCache implements ShouldQueue |
||
| 14 | { |
||
| 15 | use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 16 | |||
| 17 | protected $user; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Create a new job instance. |
||
| 21 | * |
||
| 22 | * @param MenuUser $user |
||
|
0 ignored issues
–
show
The type
PhpCollective\MenuMaker\Jobs\MenuUser was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 23 | * @return void |
||
| 24 | */ |
||
| 25 | public function __construct($user) |
||
| 26 | { |
||
| 27 | $this->user = $user; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Execute the job. |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | public function handle() |
||
| 36 | { |
||
| 37 | Menu::sections()->get()->each(function ($section) { |
||
| 38 | Cache::forget('menus.section.' . $section->id . '.user.' . $this->user->id); |
||
| 39 | }); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |