How can I use sentry with laravel 5?

前端 未结 4 1646
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 04:46

I have tried installing sentry in laravel 5 but it doesn\'t work. I would like to know if anyone has done it and how to do it.

Update: I used the instructions for La

4条回答
  •  醉梦人生
    2020-12-14 05:05

    Try Sentinel: https://github.com/rydurham/Sentinel

    add to composer

    composer require rydurham/sentinel
    

    In config/app.php

    'providers' => array(
        ...
        'Sentinel\SentinelServiceProvider', 
        ...
    )
    

    In app/Http/Kernel.php

    protected $routeMiddleware = [
        // ..
        'sentry.auth' => 'Sentinel\Middleware\SentryAuth',
        'sentry.admin' => 'Sentinel\Middleware\SentryAdminAccess',
    ];
    

    then

    publish config:

    php artisan sentinel:publish
    

    run migrations:

    php artisan migrate
    

    run seeder:

    php artisan db:seed --class=SentinelDatabaseSeeder
    

    add home route in app/routes.php

     Route::get('/', array('as' => 'home', function()
    {
        return View::make('home');
    }));
    

    all done, go to myapp.dev/login

提交回复
热议问题