Code Duplication    Length = 35-48 lines in 2 locations

src/app/Http/Controllers/AdminController.php 1 location

@@ 5-39 (lines=35) @@
2
3
namespace Backpack\Base\app\Http\Controllers;
4
5
class AdminController extends Controller
6
{
7
    protected $data = []; // the information we send to the view
8
9
    /**
10
     * Create a new controller instance.
11
     */
12
    public function __construct()
13
    {
14
        $this->middleware(backpack_middleware());
15
    }
16
17
    /**
18
     * Show the admin dashboard.
19
     *
20
     * @return \Illuminate\Http\Response
21
     */
22
    public function dashboard()
23
    {
24
        $this->data['title'] = trans('backpack::base.dashboard'); // set the page title
25
26
        return view('backpack::dashboard', $this->data);
27
    }
28
29
    /**
30
     * Redirect to the dashboard.
31
     *
32
     * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
33
     */
34
    public function redirect()
35
    {
36
        // The '/admin' route is not to be used as a page, because it breaks the menu's active state.
37
        return redirect(config('backpack.base.route_prefix').'/dashboard');
38
    }
39
}
40

src/app/Http/Controllers/Auth/ForgotPasswordController.php 1 location

@@ 8-55 (lines=48) @@
5
use Backpack\Base\app\Http\Controllers\Controller;
6
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7
8
class ForgotPasswordController extends Controller
9
{
10
    protected $data = []; // the information we send to the view
11
12
    /*
13
    |--------------------------------------------------------------------------
14
    | Password Reset Controller
15
    |--------------------------------------------------------------------------
16
    |
17
    | This controller is responsible for handling password reset emails and
18
    | includes a trait which assists in sending these notifications from
19
    | your application to your users. Feel free to explore this trait.
20
    |
21
    */
22
23
    use SendsPasswordResetEmails;
24
25
    /**
26
     * Create a new controller instance.
27
     *
28
     * @return void
29
     */
30
    public function __construct()
31
    {
32
        $this->middleware(backpack_middleware('guest'));
33
    }
34
35
    public function guard()
36
    {
37
        return \Auth::guard(backpack_guard());
38
    }
39
40
    // -------------------------------------------------------
41
    // Laravel overwrites for loading backpack views
42
    // -------------------------------------------------------
43
44
    /**
45
     * Display the form to request a password reset link.
46
     *
47
     * @return \Illuminate\Http\Response
48
     */
49
    public function showLinkRequestForm()
50
    {
51
        $this->data['title'] = trans('backpack::base.reset_password'); // set the page title
52
53
        return view('backpack::auth.passwords.email', $this->data);
54
    }
55
}
56