-
-
Notifications
You must be signed in to change notification settings - Fork 828
/
IndexController.php
40 lines (32 loc) · 1.12 KB
/
IndexController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Install\Controller;
use Flarum\Http\Controller\AbstractHtmlController;
use Flarum\Install\Installation;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Contracts\View\Factory;
use Psr\Http\Message\ServerRequestInterface as Request;
class IndexController extends AbstractHtmlController
{
public function __construct(
protected Factory $view,
protected Installation $installation
) {
}
public function render(Request $request): Renderable|string
{
$view = $this->view->make('flarum.install::app')->with('title', 'Install Flarum');
$problems = $this->installation->prerequisites()->problems();
if ($problems->isEmpty()) {
$view->with('content', $this->view->make('flarum.install::install'));
} else {
$view->with('content', $this->view->make('flarum.install::problems')->with('problems', $problems));
}
return $view;
}
}