@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $this->model = $model; |
| 43 | 43 | $activities = Activity::all(); |
| 44 | - $this->descriptions = ! is_null($activities) ? array_unique($activities->pluck('description')->toArray()) : null; |
|
| 44 | + $this->descriptions = !is_null($activities) ? array_unique($activities->pluck('description')->toArray()) : null; |
|
| 45 | 45 | $this->log_names = array_unique($activities->pluck('log_name')->toArray()); |
| 46 | 46 | $this->models = array_unique($activities->pluck('subject_type')->toArray()); |
| 47 | 47 | $this->users = User::find($activities->pluck('causer_id')->toArray()); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function deleteWithLimit() |
| 57 | 57 | { |
| 58 | - if (! is_null($this->delete_limit)) { |
|
| 58 | + if (!is_null($this->delete_limit)) { |
|
| 59 | 59 | Activity::whereDate('created_at', '<', Carbon::now()->subDays($this->delete_limit))->delete(); |
| 60 | 60 | $this->emit('activity_success', 'All activities Deleted except last '.$this->delete_limit.'days activities'); |
| 61 | 61 | } |
@@ -103,23 +103,23 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $data = Activity::query(); |
| 105 | 105 | // Filter By Log Name |
| 106 | - if (! is_null($this->log_name)) { |
|
| 106 | + if (!is_null($this->log_name)) { |
|
| 107 | 107 | $data = $data->where('log_name', $this->log_name); |
| 108 | 108 | } |
| 109 | 109 | // Filter By Model |
| 110 | - if (! is_null($this->model)) { |
|
| 110 | + if (!is_null($this->model)) { |
|
| 111 | 111 | $data = $data->where('subject_type', $this->model); |
| 112 | 112 | } |
| 113 | 113 | // Filter By User |
| 114 | - if (! is_null($this->user_id)) { |
|
| 114 | + if (!is_null($this->user_id)) { |
|
| 115 | 115 | $data = $data->where('causer_id', $this->user_id); |
| 116 | 116 | } |
| 117 | 117 | // Filter By Date |
| 118 | - if (! is_null($this->start_date) && ! is_null($this->end_date)) { |
|
| 118 | + if (!is_null($this->start_date) && !is_null($this->end_date)) { |
|
| 119 | 119 | $data = $data->whereDate('created_at', [$this->start_date, $this->end_date]); |
| 120 | 120 | } |
| 121 | 121 | // Filter Description |
| 122 | - if (! is_null($this->description)) { |
|
| 122 | + if (!is_null($this->description)) { |
|
| 123 | 123 | $data = $data->where('description', $this->description); |
| 124 | 124 | } |
| 125 | 125 | $this->activity_count = with($data)->count(); |