Skip to content

Commit

Permalink
added under construction logic and one theme part
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Jan 14, 2025
1 parent 86a6de6 commit fd5d704
Show file tree
Hide file tree
Showing 14 changed files with 642 additions and 4 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -892,4 +892,9 @@ public function productRss(){
return response($xmlContent, 200)
->header('Content-Type', 'text/xml');
}

public function underConstruction(){
$title = __('Under Construction') . ' - ' . config('app.name');
return view('client.under-construction', compact('title'));
}
}
4 changes: 4 additions & 0 deletions app/Http/Middleware/VisitorCounter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function handle(Request $request, Closure $next): Response
$visitor->page = $request->route()->getName();
$visitor->save();
}

if (getSetting('under') == '1' && !auth()->check()) {
return redirect(route('client.under-construction'));
}
return $next($request);
}
}
1 change: 1 addition & 0 deletions app/Models/Area.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Area extends Model
'search',
'slider',
'top',
'under'
];

protected $casts = [
Expand Down
9 changes: 9 additions & 0 deletions database/seeders/AreaSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ public function run(): void
'preview' => null,
'icon' => 'ri-layout-grid-line',
],
[
'name' => 'under-construction',
'valid_segments' => json_encode(
["under"]
),
'max' => 1,
'preview' => null,
'icon' => 'ri-calendar-schedule-line',
],
];

foreach ($areas as $area) {
Expand Down
Loading

0 comments on commit fd5d704

Please sign in to comment.