2017-05-17 10 views
0

저는 laravel 5.4가 있습니다. 추적기가 설치되어 있지만 지금까지 결과를 얻지 못했습니다. 마이 그 레이션을 게시했지만 모델이 없으므로 게시 설명이 제대로 작동하는지 잘 모르겠습니다. 이것이 맞는지 궁금 해서요.Laravel Tracker 결과가 생성되지 않습니다.

https://github.com/antonioribeiro/tracker

또한 어떻게 자식 문에 설정됩니다 템플릿 페이지를 호출하는 방법 궁금 해서요. 다운로드 한 파일에서이 파일을 실행했지만 추적기 구성 파일에 구성한 경로가 열리지 않습니다. 경로 파일에 추가해야하는 경로 목록이 있습니까?

트래커를 호출했을 때 발견되지 않은 오류가 발생하지 않았지만 null 데이터 세트 만 반환되었습니다.

도움을 주시면 감사하겠습니다. 시간 내 주셔서 감사합니다. 내가 할 수있는 한 그 지시를 철저히 따랐지만, 5.4를 구성하기위한 정보가 빠져있다.

저는 현재 파일 세션을 사용하고 있습니다. 그 변화를 충족시키는 것에 대해서는 아무 말도하지 않습니다.

*** 웹 미들웨어 내에 다중 인증 시스템이 있다는 것을 언급해야합니다. 두 가드 모두 웹 미들웨어에 내장되어 있습니다. 나는 정상적인 사용자로 로그인 한 상태에서 통계 페이지를 일시적으로 보려고 할 때 이것이 문제라고 생각하지 않습니다.

추적기 구성 파일

<?php 
return [ 
    /* 
    * Enable it? 
    */ 
    'enabled' => true, 
    /* 
    * Enable cache? 
    */ 
    'cache_enabled' => true, 
    /* 
    * Deffer booting for middleware use 
    */ 
    'use_middleware' => true, 
    /* 
    * Robots should be tracked? 
    */ 
    'do_not_track_robots' => false, 
    /* 
    * Which environments are not trackable? 
    */ 
    'do_not_track_environments' => [ 
     // defaults to none 
    ], 
    /* 
    * Which routes names are not trackable? 
    */ 
    'do_not_track_routes' => [ 
     'tracker.stats.*', 
    ], 
    /* 
    * The Do Not Track Ips is used to disable Tracker for some IP addresses: 
    * 
    *  '127.0.0.1', '192.168.1.1' 
    * 
    * You can set ranges of IPs 
    *  '192.168.0.1-192.168.0.100' 
    * 
    * And use net masks 
    *  '10.0.0.0/32' 
    *  '172.17.0.0/255.255.0.0' 
    */ 
    'do_not_track_ips' => [ 
    // '127.0.0.0/24', /// range 127.0.0.1 - 127.0.0.255 
    ], 
    /* 
    * Log every single access? 
    * 
    * The log table can become huge if your site is popular, but... 
    * 
    * Log table is also responsible for storing information on: 
    * 
    * - Routes and controller actions accessed 
    * - HTTP method used (GET, POST...) 
    * - Error log 
    * - URL queries (including values) 
    */ 
    'log_enabled' => false, 
    /* 
    * Log SQL queries? 
    * 
    * Log must be enabled for this option to work. 
    */ 
    'log_sql_queries' => false, 
    /* 
    * If you prefer to store Tracker data on a different database or connection, 
    * you can set it here. 
    * 
    * To avoid SQL queries log recursion, create a different connection for Tracker, 
    * point it to the same database (or not) and forbid logging of this connection in 
    * do_not_log_sql_queries_connections. 
    */ 
    'connection' => 'tracker', 
    /* 
    * Forbid logging of SQL queries for some connections. 
    * 
    * To avoid recursion, you better ignore Tracker connection here. 
    * 
    * Please create a separate database connection for Tracker. It can hit 
    * the same database of your application, but the connection itself 
    * has to have a different name, so the package can ignore its own queries 
    * and avoid recursion. 
    * 
    */ 
    'do_not_log_sql_queries_connections' => [ 
     'tracker', 
    ], 
    /* 
    * Also log SQL query bindings? 
    * 
    * Log must be enabled for this option to work. 
    */ 
    'log_sql_queries_bindings' => false, 
    /* 
    * Log events? 
    */ 
    'log_events' => false, 
    /* 
    * Which events do you want to log exactly? 
    */ 
    'log_only_events' => [ 
     // defaults to logging all events 
    ], 
    /* 
    * What are the names of the id columns on your system? 
    * 
    * 'id' is the most common, but if you have one or more different, 
    * please add them here in your preference order. 
    */ 
    'id_columns_names' => [ 
     'id', 
    ], 
    /* 
    * Do not log events for the following patterns. 
    * Strings accepts wildcards: 
    * 
    * eloquent.* 
    * 
    */ 
    'do_not_log_events' => [ 
     'illuminate.log', 
     'eloquent.*', 
     'router.*', 
     'composing: *', 
     'creating: *', 
    ], 
    /* 
    * Do you wish to log Geo IP data? 
    * 
    * You will need to install the geoip package 
    * 
    *  composer require "geoip/geoip":"~1.14" 
    * 
    * And remove the PHP module 
    * 
    *  sudo apt-get purge php5-geoip 
    * 
    */ 
    'log_geoip' => false, 
    /* 
    * Do you wish to log the user agent? 
    */ 
    'log_user_agents' => false, 
    /* 
    * Do you wish to log your users? 
    */ 
    'log_users' => false, 
    /* 
    * Do you wish to log devices? 
    */ 
    'log_devices' => false, 
    /* 
    * Do you wish to log languages? 
    */ 
    'log_languages' => false, 
    /* 
    * Do you wish to log HTTP referers? 
    */ 
    'log_referers' => false, 
    /* 
    * Do you wish to log url paths? 
    */ 
    'log_paths' => false, 
    /* 
    * Do you wish to log url queries and query arguments? 
    */ 
    'log_queries' => false, 
    /* 
    * Do you wish to log routes and route parameters? 
    */ 
    'log_routes' => false, 
    /* 
    * Log errors and exceptions? 
    */ 
    'log_exceptions' => false, 
    /* 
    * A cookie may be created on your visitor device, so you can have information 
    * on everything made using that device on your site. * 
    */ 
    'store_cookie_tracker' => false, 
    /* 
    * If you are storing cookies, you better change it to a name you of your own. 
    */ 
    'tracker_cookie_name' => 'please_change_this_cookie_name', 
    /* 
    * Internal tracker session name. 
    */ 
    'tracker_session_name' => 'tracker_session', 
    /* 
    * ** IMPORTANT ** 
    * Change the user model to your own. 
    */ 
    'user_model' => 'App\User', 
    /* 
    * You can use your own model for every single table Tracker has. 
    */ 
    'session_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Session', 
    'log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Log', 
    'path_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Path', 
    'query_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Query', 
    'query_argument_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\QueryArgument', 
    'agent_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Agent', 
    'device_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Device', 
    'cookie_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Cookie', 
    'domain_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Domain', 
    'referer_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Referer', 
    'referer_search_term_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RefererSearchTerm', 
    'route_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Route', 
    'route_path_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RoutePath', 
    'route_path_parameter_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\RoutePathParameter', 
    'error_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Error', 
    'geoip_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\GeoIp', 
    'sql_query_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQuery', 
    'sql_query_binding_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryBinding', 
    'sql_query_binding_parameter_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryBindingParameter', 
    'sql_query_log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SqlQueryLog', 
    'connection_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Connection', 
    'event_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Event', 
    'event_log_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\EventLog', 
    'system_class_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\SystemClass', 
    'language_model' => 'PragmaRX\Tracker\Vendor\Laravel\Models\Language', 
    /* 
    * Laravel internal variables on user authentication and login. 
    */ 
    'authentication_ioc_binding' => ['auth','admin'], // defaults to 'auth' in Illuminate\Support\Facades\Auth 
    'authenticated_check_method' => 'check', // to Auth::check() 
    'authenticated_user_method' => 'user', // to Auth::user() 
    'authenticated_user_id_column' => 'id', // to Auth::user()->id 
    'authenticated_user_username_column' => 'email', // to Auth::user()->email 
    /* 
    * Enable the Stats Panel? 
    */ 
    'stats_panel_enabled' => false, 
    /* 
    * Stats Panel routes before filter 
    * 
    */ 
    'stats_routes_before_filter' => '', 
    /* 
    * Stats Panel routes after filter 
    * 
    */ 
    'stats_routes_after_filter' => '', 
    /* 
    * Stats Panel routes middleware 
    * 
    */ 
    'stats_routes_middleware' => 'web', 
    /* 
    * Stats Panel template path 
    */ 
    'stats_template_path' => '/templates/sb-admin-2', 
    /* 
    * Stats Panel base uri. 
    * 
    * If your site url is http://wwww.mysite.com, then your stats page will be: 
    * 
    * http://wwww.mysite.com/stats 
    * 
    */ 
    'stats_base_uri' => 'admin/stats', 
    /* 
    * Stats Panel layout view 
    */ 
    'stats_layout' => 'pragmarx/tracker::layout', 
    /* 
    * Stats Panel controllers namespace 
    */ 
    'stats_controllers_namespace' => 'PragmaRX\Tracker\Vendor\Laravel\Controllers', 
]; 

답변

0

은 별도의 모델을 필요로처럼은 보이지 않는다. php artisan vendor:publish 명령을 실행 한 경우 5.4에서 필요한 공용 파일을 사용할 수 있어야합니다.

옵션 파일은 App \ User 모델을 이미 사용하고 있으며 다른 옵션이 필요 없다고 지정합니다. 이 줄을 변경해야합니다 : 'stats_panel_enabled' => false ~ true. 또한 마지막 단계에서 지정한대로 App \ User에 is_admin 속성을 설정 했습니까?

트래커보기에 연결할 수없는 경우에도 데이터베이스 테이블에 모든 항목이 표시됩니까?

+0

답장을 보내 주셔서 감사합니다. 그건 내가 한 걸음 가까이 다가왔다. 그러나 설정 파일에 설정 한 통계 페이지에 액세스 할 수있는 사람은 아무도 없지만 "사용자 모델에 관리자 속성이 누락되었습니다."라는 오류가 표시됩니다.이 오류에 대한 검색은 이전 결론이 작동하지 않습니다. // 위의 정보 추가 // 추적기 테이블을 위해 내 데이터베이스에서 활동으로 돌아가거나 새 레코드를 보지 못하는 추적기 함수가 아직 없습니다. 한 걸음 더 다가 가면서 몇 가지 문제가 있습니다. – Pete