@@ -9,31 +9,31 @@ |
||
9 | 9 | class CreateAccessLogTable extends Migration |
10 | 10 | { |
11 | 11 | |
12 | - public function up() |
|
13 | - { |
|
14 | - Schema::create('user_access_log', function($table) |
|
15 | - { |
|
16 | - $table->engine = 'InnoDB'; |
|
17 | - $table->increments('id'); |
|
18 | - |
|
19 | - $table->integer('user_id')->unsigned()->nullable(); |
|
20 | - $table->foreign('user_id')->references('id')->on('users')->onDelete('set null'); |
|
21 | - |
|
22 | - $table->string('ip_address')->nullable(); |
|
23 | - |
|
24 | - $table->timestamps(); |
|
25 | - }); |
|
26 | - } |
|
27 | - |
|
28 | - public function down() |
|
29 | - { |
|
30 | - DB::statement("SET foreign_key_checks = 0"); |
|
31 | - Schema::table('user_access_log', function($table) |
|
32 | - { |
|
33 | - $table->dropForeign('user_access_log_user_id_foreign'); |
|
34 | - }); |
|
35 | - Schema::dropIfExists('user_access_log'); |
|
36 | - DB::statement("SET foreign_key_checks = 1"); |
|
37 | - } |
|
12 | + public function up() |
|
13 | + { |
|
14 | + Schema::create('user_access_log', function($table) |
|
15 | + { |
|
16 | + $table->engine = 'InnoDB'; |
|
17 | + $table->increments('id'); |
|
18 | + |
|
19 | + $table->integer('user_id')->unsigned()->nullable(); |
|
20 | + $table->foreign('user_id')->references('id')->on('users')->onDelete('set null'); |
|
21 | + |
|
22 | + $table->string('ip_address')->nullable(); |
|
23 | + |
|
24 | + $table->timestamps(); |
|
25 | + }); |
|
26 | + } |
|
27 | + |
|
28 | + public function down() |
|
29 | + { |
|
30 | + DB::statement("SET foreign_key_checks = 0"); |
|
31 | + Schema::table('user_access_log', function($table) |
|
32 | + { |
|
33 | + $table->dropForeign('user_access_log_user_id_foreign'); |
|
34 | + }); |
|
35 | + Schema::dropIfExists('user_access_log'); |
|
36 | + DB::statement("SET foreign_key_checks = 1"); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | } |
@@ -38,24 +38,24 @@ |
||
38 | 38 | * |
39 | 39 | * @return array |
40 | 40 | */ |
41 | - public function defineProperties() |
|
42 | - { |
|
43 | - return [ |
|
44 | - 'title' => [ |
|
45 | - 'title' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartlineaggregated.title', |
|
46 | - 'default' => 'Access statistics in time', |
|
47 | - 'type' => 'string', |
|
48 | - 'validationPattern' => '^.+$', |
|
49 | - 'validationMessage' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartlineaggregated.title_validation', |
|
50 | - ], |
|
41 | + public function defineProperties() |
|
42 | + { |
|
43 | + return [ |
|
44 | + 'title' => [ |
|
45 | + 'title' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartlineaggregated.title', |
|
46 | + 'default' => 'Access statistics in time', |
|
47 | + 'type' => 'string', |
|
48 | + 'validationPattern' => '^.+$', |
|
49 | + 'validationMessage' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartlineaggregated.title_validation', |
|
50 | + ], |
|
51 | 51 | 'days' => [ |
52 | 52 | 'title' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartlineaggregated.days_title', |
53 | 53 | 'default' => '30', |
54 | 54 | 'type' => 'string', |
55 | 55 | 'validationPattern' => '^[0-9]+$', |
56 | 56 | ] |
57 | - ]; |
|
58 | - } |
|
57 | + ]; |
|
58 | + } |
|
59 | 59 | |
60 | 60 | protected function loadData() |
61 | 61 | { |
@@ -35,24 +35,24 @@ |
||
35 | 35 | return $this->makePartial('widget'); |
36 | 36 | } |
37 | 37 | |
38 | - public function defineProperties() |
|
39 | - { |
|
40 | - return [ |
|
41 | - 'title' => [ |
|
38 | + public function defineProperties() |
|
39 | + { |
|
40 | + return [ |
|
41 | + 'title' => [ |
|
42 | 42 | 'title' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartline.title', |
43 | 43 | 'default' => 'Access statistics in time each user', |
44 | - 'type' => 'string', |
|
45 | - 'validationPattern' => '^.+$', |
|
46 | - 'validationMessage' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartline.title_validation', |
|
47 | - ], |
|
44 | + 'type' => 'string', |
|
45 | + 'validationPattern' => '^.+$', |
|
46 | + 'validationMessage' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartline.title_validation', |
|
47 | + ], |
|
48 | 48 | 'days' => [ |
49 | 49 | 'title' => 'vojtasvoboda.useraccesslog::lang.reportwidgets.chartline.days_title', |
50 | 50 | 'default' => '30', |
51 | 51 | 'type' => 'string', |
52 | 52 | 'validationPattern' => '^[0-9]+$', |
53 | 53 | ] |
54 | - ]; |
|
55 | - } |
|
54 | + ]; |
|
55 | + } |
|
56 | 56 | |
57 | 57 | protected function loadData() |
58 | 58 | { |