Skip to content

Commit e907f3f

Browse files
authored
Merge pull request #30 from azorpax/master
Fix undefined variable $userActivities when datatables is true
2 parents 978620e + 32e6204 commit e907f3f

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ LARAVEL_LOGGER_DATABASE_CONNECTION=mysql
118118
LARAVEL_LOGGER_DATABASE_TABLE=laravel_logger_activity
119119
LARAVEL_LOGGER_ROLES_ENABLED=true
120120
LARAVEL_LOGGER_ROLES_MIDDLWARE=role:admin
121-
LARAVEL_LOGGER_ROLE_MODEL=jeremykenedy\LaravelRoles\Models\Role
122121
LARAVEL_LOGGER_MIDDLEWARE_ENABLED=true
123122
LARAVEL_LOGGER_MIDDLEWARE_EXCEPT=
124123
LARAVEL_LOGGER_USER_MODEL=App\User
@@ -129,18 +128,21 @@ LARAVEL_LOGGER_DASHBOARD_MENU_ENABLED=true
129128
LARAVEL_LOGGER_DASHBOARD_DRILLABLE=true
130129
LARAVEL_LOGGER_LOG_RECORD_FAILURES_TO_FILE=true
131130
LARAVEL_LOGGER_FLASH_MESSAGE_BLADE_ENABLED=true
131+
LARAVEL_LOGGER_LAYOUT=layouts.app
132+
LARAVEL_LOGGER_BOOTSTRAP_VERSION=4
133+
LARAVEL_LOGGER_BLADE_PLACEMENT=stack #option: yield or stack
134+
LARAVEL_LOGGER_BLADE_PLACEMENT_CSS=css-header #placement name
135+
LARAVEL_LOGGER_BLADE_PLACEMENT_JS=scripts-footer #placement name
132136
LARAVEL_LOGGER_JQUERY_CDN_ENABLED=true
133137
LARAVEL_LOGGER_JQUERY_CDN_URL=https://code.jquery.com/jquery-2.2.4.min.js
134-
LARAVEL_LOGGER_BLADE_PLACEMENT=yield #option: yield or stack
135-
LARAVEL_LOGGER_BLADE_PLACEMENT_CSS=template_linked_css #placement name
136-
LARAVEL_LOGGER_BLADE_PLACEMENT_JS=footer_scripts #placement name
138+
LARAVEL_LOGGER_BOOTSTRAP_CSS_CDN_ENABLED=true
139+
LARAVEL_LOGGER_BOOTSTRAP_CSS_CDN_URL=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css
137140
LARAVEL_LOGGER_BOOTSTRAP_JS_CDN_ENABLED=true
138141
LARAVEL_LOGGER_BOOTSTRAP_JS_CDN_URL=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js
142+
LARAVEL_LOGGER_POPPER_JS_CDN_ENABLED=true
143+
LARAVEL_LOGGER_POPPER_JS_CDN_URL=https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js
139144
LARAVEL_LOGGER_FONT_AWESOME_CDN_ENABLED=true
140145
LARAVEL_LOGGER_FONT_AWESOME_CDN_URL=https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css
141-
LARAVEL_LOGGER_BOOTSTRAP_CSS_CDN_ENABLED=true
142-
LARAVEL_LOGGER_BOOTSTRAP_CSS_CDN_URL=https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css
143-
LARAVEL_LOGGER_POPPER_JS_CDN_URL=https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js
144146
```
145147

146148
### Usage
@@ -262,8 +264,8 @@ To use the trait:
262264
│   │   └── confirm-modal.blade.php
263265
│   ├── partials
264266
│   │   ├── form-status.blade.php
265-
│   │   ├── styles.blade.php
266-
| | └── scripts.blade.php
267+
│   │   ├── scripts.blade.php
268+
| | └── styles.blade.php
267269
│   └── scripts
268270
│   ├── clickable-row.blade.php
269271
│   ├── confirm-modal.blade.php

src/config/laravel-logger.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
|--------------------------------------------------------------------------
2727
*/
2828

29-
'loggerMiddlewareEnabled' => env('LARAVEL_LOGGER_MIDDLEWARE_ENABLED', true),
30-
'loggerMiddlewareExcept' => array_filter(explode(',', trim(env('LARAVEL_LOGGER_MIDDLEWARE_EXCEPT')))),
29+
'loggerMiddlewareEnabled' => env('LARAVEL_LOGGER_MIDDLEWARE_ENABLED', true),
30+
'loggerMiddlewareExcept' => array_filter(explode(',', trim(env('LARAVEL_LOGGER_MIDDLEWARE_EXCEPT')))),
3131

3232
/*
3333
|--------------------------------------------------------------------------
@@ -101,15 +101,15 @@
101101
*/
102102

103103
// The parent Blade file
104-
'loggerBladeExtended' => 'layouts.app',
104+
'loggerBladeExtended' => env('LARAVEL_LOGGER_LAYOUT', 'layouts.app'),
105105

106106
// Switch Between bootstrap 3 `panel` and bootstrap 4 `card` classes
107-
'bootstapVersion' => '4',
107+
'bootstapVersion' => env('LARAVEL_LOGGER_BOOTSTRAP_VERSION', '4'),
108108

109109
// Additional Card classes for styling -
110110
// See: https://getbootstrap.com/docs/4.0/components/card/#background-and-color
111111
// Example classes: 'text-white bg-primary mb-3'
112-
'bootstrapCardClasses' => '',
112+
'bootstrapCardClasses' => '',
113113

114114
// Blade Extension Placement
115115
'bladePlacement' => env('LARAVEL_LOGGER_BLADE_PLACEMENT', 'yield'),
@@ -138,4 +138,4 @@
138138
'enableFontAwesomeCDN' => env('LARAVEL_LOGGER_FONT_AWESOME_CDN_ENABLED', true),
139139
'fontAwesomeCDN' => env('LARAVEL_LOGGER_FONT_AWESOME_CDN_URL', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'),
140140

141-
];
141+
];

src/resources/views/logger/activity-log-cleared.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@push(config('LaravelLogger.bladePlacementJs'))
2121
@endif
2222

23-
@include('LaravelLogger::partials.scripts')
23+
@include('LaravelLogger::partials.scripts', ['activities' => $activities])
2424
@include('LaravelLogger::scripts.confirm-modal', ['formTrigger' => '#confirmDelete'])
2525
@include('LaravelLogger::scripts.confirm-modal', ['formTrigger' => '#confirmRestore'])
2626

src/resources/views/logger/activity-log-item.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@push(config('LaravelLogger.bladePlacementJs'))
2121
@endif
2222

23-
@include('LaravelLogger::partials.scripts')
23+
@include('LaravelLogger::partials.scripts', ['activities' => $userActivities])
2424

2525
@if(config('LaravelLogger.bladePlacement') == 'yield')
2626
@endsection
@@ -381,4 +381,4 @@
381381
</div>
382382
</div>
383383
</div>
384-
@endsection
384+
@endsection

src/resources/views/logger/activity-log.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@push(config('LaravelLogger.bladePlacementJs'))
2121
@endif
2222

23-
@include('LaravelLogger::partials.scripts')
23+
@include('LaravelLogger::partials.scripts', ['activities' => $activities])
2424
@include('LaravelLogger::scripts.confirm-modal', ['formTrigger' => '#confirmDelete'])
2525

2626
@if(config('LaravelLogger.enableDrillDown'))

src/resources/views/partials/scripts.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@endif
1313

1414
@if(config('LaravelLogger.loggerDatatables'))
15-
@if (count($userActivities) > 10)
15+
@if (count($activities) > 10)
1616
@include('LaravelLogger::scripts.datatables')
1717
@endif
1818
@endif

src/resources/views/partials/styles.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
border: none;
2121
}
2222
23-
.activity-table > table > tbody td.ellipsis {
23+
table > tbody td.ellipsis {
2424
max-width: 350px;
2525
white-space: nowrap;
2626
overflow: hidden;

0 commit comments

Comments
 (0)