Skip to content

Commit

Permalink
Add $showReviews as a shared view data
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Dec 31, 2023
1 parent a763741 commit 4c07e34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Igniter\Local\Models\Review;
use Igniter\Local\Models\ReviewSettings;
use Igniter\Local\Models\Scopes\LocationScope;
use Igniter\Main\Classes\MainController;
use Igniter\Reservation\Models\Reservation;
use Igniter\User\Facades\Auth;
use Igniter\User\Models\User;
Expand Down Expand Up @@ -64,8 +65,8 @@ public function register()

public function boot()
{
View::composer('*', function ($view) {
$view->with('showReviews', (bool)ReviewSettings::get('allow_reviews', false));
Event::listen('main.page.init', function (MainController $controller) {
View::share('showReviews', (bool)ReviewSettings::get('allow_reviews', false));
});

$this->bindRememberLocationAreaEvents();
Expand Down

0 comments on commit 4c07e34

Please sign in to comment.