|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Backpack\CRUD\app\Http\Controllers; |
|
4
|
|
|
|
|
5
|
|
|
use Facade\FlareClient\Flare; |
|
|
|
|
|
|
6
|
|
|
use Facade\Ignition\ErrorPage\ErrorPageHandler; |
|
|
|
|
|
|
7
|
|
|
use Illuminate\Http\Request; |
|
8
|
|
|
use Illuminate\Routing\Controller; |
|
9
|
|
|
|
|
10
|
|
|
class AdminController extends Controller |
|
11
|
|
|
{ |
|
12
|
|
|
protected $data = []; // the information we send to the view |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Create a new controller instance. |
|
16
|
|
|
*/ |
|
17
|
|
|
public function __construct() |
|
18
|
|
|
{ |
|
19
|
|
|
$this->middleware(backpack_middleware()); |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Show the admin dashboard. |
|
24
|
|
|
* |
|
25
|
|
|
* @return \Illuminate\Http\Response |
|
26
|
|
|
*/ |
|
27
|
|
|
public function dashboard() |
|
28
|
|
|
{ |
|
29
|
|
|
$this->data['title'] = trans('backpack::base.dashboard'); // set the page title |
|
30
|
|
|
$this->data['breadcrumbs'] = [ |
|
31
|
|
|
trans('backpack::crud.admin') => backpack_url('dashboard'), |
|
32
|
|
|
trans('backpack::base.dashboard') => false, |
|
33
|
|
|
]; |
|
34
|
|
|
|
|
35
|
|
|
return view(backpack_view('dashboard'), $this->data); |
|
|
|
|
|
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Redirect to the dashboard. |
|
40
|
|
|
* |
|
41
|
|
|
* @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse |
|
42
|
|
|
*/ |
|
43
|
|
|
public function redirect() |
|
44
|
|
|
{ |
|
45
|
|
|
// The '/admin' route is not to be used as a page, because it breaks the menu's active state. |
|
46
|
|
|
return redirect(backpack_url('dashboard')); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Show the error. |
|
51
|
|
|
* |
|
52
|
|
|
* @return \Illuminate\Http\Response |
|
53
|
|
|
*/ |
|
54
|
|
|
public function errorFrame(Request $request) |
|
55
|
|
|
{ |
|
56
|
|
|
$handler = app(ErrorPageHandler::class); |
|
57
|
|
|
$client = app()->make(Flare::class); |
|
58
|
|
|
|
|
59
|
|
|
$exception = new $request->exception($request->message, 0, 1, $request->file, $request->line); |
|
60
|
|
|
|
|
61
|
|
|
$report = $client->createReport($exception); |
|
62
|
|
|
|
|
63
|
|
|
$handler->handleReport($report); |
|
|
|
|
|
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
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.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths