|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Tinyissue package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Mohamed Alsharaf <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Tinyissue\Http\Controllers; |
|
13
|
|
|
|
|
14
|
|
|
use Illuminate\Database\Eloquent\Collection; |
|
15
|
|
|
use Illuminate\Http\Request; |
|
16
|
|
|
use Tinyissue\Contracts\Repository\Project\ProjectRepository; |
|
17
|
|
|
use Tinyissue\Form\FilterIssue as FilterForm; |
|
18
|
|
|
use Tinyissue\Form\Note as NoteForm; |
|
19
|
|
|
use Tinyissue\Form\Project as Form; |
|
20
|
|
|
use Tinyissue\Http\Requests\FormRequest; |
|
21
|
|
|
use Tinyissue\Model\Project; |
|
22
|
|
|
use Tinyissue\Model\Project\Issue; |
|
23
|
|
|
use Tinyissue\Model\Project\Note; |
|
24
|
|
|
use Tinyissue\Repository\Project\Note\NoteRepository; |
|
25
|
|
|
use Tinyissue\Repository\Role\RoleRepository; |
|
26
|
|
|
use Tinyissue\Services\Exporter; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* ProjectController is the controller class for managing request related to a project. |
|
30
|
|
|
* |
|
31
|
|
|
* @author Mohamed Alsharaf <[email protected]> |
|
32
|
|
|
*/ |
|
33
|
|
|
class ProjectController extends Controller |
|
34
|
|
|
{ |
|
35
|
|
|
protected function indexView($data, $active, ProjectRepository $project) |
|
36
|
|
|
{ |
|
37
|
|
|
$isUser = $this->isLoggedIn() && $this->getLoggedUser()->isUser(); |
|
38
|
|
|
$isInternalProject = $project->isPrivateInternal(); |
|
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
if (array_key_exists('assigned_issues_count', $data) && $this->isLoggedIn() && (!$isInternalProject || (!$isUser && $isInternalProject))) { |
|
41
|
|
|
$data['created_issues_count'] = $project->countCreatedIssues($this->getLoggedUser()); |
|
|
|
|
|
|
42
|
|
|
} else { |
|
43
|
|
|
$data['assigned_issues_count'] = $project->countAssignedIssues($this->getLoggedUser()); |
|
|
|
|
|
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
$data['sidebar'] = 'project'; |
|
47
|
|
|
$data['active'] = $active; |
|
48
|
|
|
$data['project'] = $project; |
|
49
|
|
|
$data['usersCanFixIssues'] = $project->getUsersCanFixIssue(); |
|
50
|
|
|
|
|
51
|
|
|
return view('project.index', $data); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Display activity for a project. |
|
56
|
|
|
* |
|
57
|
|
|
* @param ProjectRepository $project |
|
58
|
|
|
* |
|
59
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
60
|
|
|
*/ |
|
61
|
|
View Code Duplication |
public function getIndex(ProjectRepository $project) |
|
|
|
|
|
|
62
|
|
|
{ |
|
63
|
|
|
$activities = $project->getRecentActivities($this->getLoggedUser()); |
|
64
|
|
|
|
|
65
|
|
|
return $this->indexView([ |
|
66
|
|
|
'activities' => $activities, |
|
67
|
|
|
'notes_count' => $project->countNotes(), |
|
|
|
|
|
|
68
|
|
|
'open_issues_count' => $project->countOpenIssues($this->getLoggedUser()), |
|
|
|
|
|
|
69
|
|
|
'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()), |
|
|
|
|
|
|
70
|
|
|
], 'activity', $project); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* Display issues for a project. |
|
75
|
|
|
* |
|
76
|
|
|
* @param FilterForm $filterForm |
|
77
|
|
|
* @param Request $request |
|
78
|
|
|
* @param ProjectRepository $project |
|
79
|
|
|
* @param int $status |
|
80
|
|
|
* |
|
81
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
82
|
|
|
*/ |
|
83
|
|
|
public function getIssues(FilterForm $filterForm, Request $request, ProjectRepository $project, $status = Issue::STATUS_OPEN) |
|
84
|
|
|
{ |
|
85
|
|
|
if ($project->isPrivateInternal() && $this->getLoggedUser()->isUser()) { |
|
|
|
|
|
|
86
|
|
|
$request['created_by'] = $this->getLoggedUser()->id; |
|
|
|
|
|
|
87
|
|
|
} |
|
88
|
|
|
$issues = $project->getIssues($status, $request->all()); |
|
89
|
|
|
|
|
90
|
|
|
if ($status === Issue::STATUS_OPEN) { |
|
91
|
|
|
$data = $this->getOpenIssuesViewData($issues, $project); |
|
92
|
|
|
} else { |
|
93
|
|
|
$data = $this->getClosedIssuesViewData($issues, $project); |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
$data['notes_count'] = $project->countNotes(); |
|
|
|
|
|
|
97
|
|
|
$data['issues'] = $issues; |
|
98
|
|
|
$data['filterForm'] = $filterForm; |
|
99
|
|
|
|
|
100
|
|
|
return $this->indexView($data, $data['active'], $project); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
protected function getOpenIssuesViewData(Collection $issues, ProjectRepository $project) |
|
104
|
|
|
{ |
|
105
|
|
|
return [ |
|
106
|
|
|
'open_issues_count' => $issues->count(), |
|
107
|
|
|
'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()), |
|
|
|
|
|
|
108
|
|
|
'active' => 'open_issues', |
|
109
|
|
|
]; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
protected function getClosedIssuesViewData(Collection $issues, ProjectRepository $project) |
|
113
|
|
|
{ |
|
114
|
|
|
return [ |
|
115
|
|
|
'open_issues_count' => $project->countOpenIssues($this->getLoggedUser()), |
|
|
|
|
|
|
116
|
|
|
'closed_issues_count' => $issues->count(), |
|
117
|
|
|
'active' => 'closed_issues', |
|
118
|
|
|
]; |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* Display issues assigned to current user for a project. |
|
123
|
|
|
* |
|
124
|
|
|
* @param ProjectRepository $project |
|
125
|
|
|
* |
|
126
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
127
|
|
|
*/ |
|
128
|
|
View Code Duplication |
public function getAssigned(ProjectRepository $project) |
|
|
|
|
|
|
129
|
|
|
{ |
|
130
|
|
|
$issues = $project->getAssignedOrCreatedIssues($this->getLoggedUser()); |
|
131
|
|
|
|
|
132
|
|
|
return $this->indexView([ |
|
133
|
|
|
'notes_count' => $project->countNotes(), |
|
|
|
|
|
|
134
|
|
|
'open_issues_count' => $project->countOpenIssues($this->getLoggedUser()), |
|
|
|
|
|
|
135
|
|
|
'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()), |
|
|
|
|
|
|
136
|
|
|
'assigned_issues_count' => $issues->count(), |
|
137
|
|
|
'issues' => $issues, |
|
138
|
|
|
], 'activity', $project); |
|
139
|
|
|
} |
|
140
|
|
|
|
|
141
|
|
|
/** |
|
142
|
|
|
* Display issues created to current user for a project. |
|
143
|
|
|
* |
|
144
|
|
|
* @param ProjectRepository $project |
|
145
|
|
|
* |
|
146
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
147
|
|
|
*/ |
|
148
|
|
View Code Duplication |
public function getCreated(ProjectRepository $project) |
|
|
|
|
|
|
149
|
|
|
{ |
|
150
|
|
|
$issues = $project->getAssignedOrCreatedIssues($this->getLoggedUser()); |
|
151
|
|
|
|
|
152
|
|
|
return $this->indexView([ |
|
153
|
|
|
'notes_count' => $project->countNotes(), |
|
|
|
|
|
|
154
|
|
|
'open_issues_count' => $project->countOpenIssues($this->getLoggedUser()), |
|
|
|
|
|
|
155
|
|
|
'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()), |
|
|
|
|
|
|
156
|
|
|
'assigned_issues_count' => $issues->count(), |
|
157
|
|
|
'issues' => $issues, |
|
158
|
|
|
], 'issue_created_by_you', $project); |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
/** |
|
162
|
|
|
* Display notes for a project. |
|
163
|
|
|
* |
|
164
|
|
|
* @param ProjectRepository $project |
|
165
|
|
|
* @param NoteForm $form |
|
166
|
|
|
* |
|
167
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
168
|
|
|
*/ |
|
169
|
|
View Code Duplication |
public function getNotes(ProjectRepository $project, NoteForm $form) |
|
|
|
|
|
|
170
|
|
|
{ |
|
171
|
|
|
$notes = $project->getNotes(); |
|
172
|
|
|
|
|
173
|
|
|
return $this->indexView([ |
|
174
|
|
|
'notes_count' => $project->countNotes(), |
|
|
|
|
|
|
175
|
|
|
'open_issues_count' => $project->countOpenIssues($this->getLoggedUser()), |
|
|
|
|
|
|
176
|
|
|
'closed_issues_count' => $project->countClosedIssues($this->getLoggedUser()), |
|
|
|
|
|
|
177
|
|
|
'notes' => $notes, |
|
178
|
|
|
'notes_count' => $notes->count(), |
|
179
|
|
|
], 'notes', $project); |
|
180
|
|
|
} |
|
181
|
|
|
|
|
182
|
|
|
/** |
|
183
|
|
|
* @param Project $project |
|
184
|
|
|
* @param string $view |
|
185
|
|
|
* @param null $data |
|
186
|
|
|
* @param bool $status |
|
187
|
|
|
* |
|
188
|
|
|
* @return array |
|
189
|
|
|
*/ |
|
190
|
|
|
protected function projectMainViewTabs(ProjectRepository $project, $view, $data = null, $status = false) |
|
|
|
|
|
|
191
|
|
|
{ |
|
192
|
|
|
return null; |
|
193
|
|
|
$user = $this->getLoggedUser(); |
|
|
|
|
|
|
194
|
|
|
$isLoggedIn = !$this->auth->guest(); |
|
195
|
|
|
$isUser = $isLoggedIn && $user->isUser(); |
|
196
|
|
|
$isInternalProject = $project->isPrivateInternal(); |
|
197
|
|
|
|
|
198
|
|
|
if ($view === 'note') { |
|
199
|
|
|
$notesCount = !is_null($data) ? $data->count() : 0; |
|
200
|
|
|
} else { |
|
201
|
|
|
$notesCount = $project->countNotes(); |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
if ($view === 'issues') { |
|
205
|
|
|
if ($status == Issue::STATUS_OPEN) { |
|
206
|
|
|
$closedIssuesCount = $project->closedIssuesCount($user)->count(); |
|
207
|
|
|
$openIssuesCount = !is_null($data) ? $data->count() : 0; |
|
208
|
|
|
} else { |
|
209
|
|
|
$closedIssuesCount = !is_null($data) ? $data->count() : 0; |
|
210
|
|
|
$openIssuesCount = $project->openIssuesCount($user)->count(); |
|
211
|
|
|
} |
|
212
|
|
|
} else { |
|
213
|
|
|
$openIssuesCount = $project->openIssuesCount($user)->count(); |
|
214
|
|
|
$closedIssuesCount = $project->closedIssuesCount($user)->count(); |
|
215
|
|
|
} |
|
216
|
|
|
|
|
217
|
|
|
$tabs = []; |
|
218
|
|
|
$tabs[] = [ |
|
219
|
|
|
'url' => $project->to(), |
|
220
|
|
|
'page' => 'activity', |
|
221
|
|
|
]; |
|
222
|
|
|
$tabs[] = [ |
|
223
|
|
|
'url' => $project->to('issues'), |
|
224
|
|
|
'page' => 'open_issue', |
|
225
|
|
|
'prefix' => $openIssuesCount, |
|
226
|
|
|
]; |
|
227
|
|
|
$tabs[] = [ |
|
228
|
|
|
'url' => $project->to('issues') . '/0', |
|
229
|
|
|
'page' => 'closed_issue', |
|
230
|
|
|
'prefix' => $closedIssuesCount, |
|
231
|
|
|
]; |
|
232
|
|
|
if ($isLoggedIn && (!$isInternalProject || (!$isUser && $isInternalProject))) { |
|
233
|
|
|
if ($view !== 'assigned') { |
|
234
|
|
|
$method = $isUser ? 'createdIssuesCount' : 'assignedIssuesCount'; |
|
235
|
|
|
$assignedIssuesCount = $this->getLoggedUser()->$method($project->id); |
|
236
|
|
|
} else { |
|
237
|
|
|
$assignedIssuesCount = !is_null($data) ? $data->count() : 0; |
|
238
|
|
|
} |
|
239
|
|
|
|
|
240
|
|
|
$tabs[] = [ |
|
241
|
|
|
'url' => $project->to($isUser ? 'created' : 'assigned'), |
|
242
|
|
|
'page' => ($isUser ? 'issue_created_by_you' : 'issue_assigned_to_you'), |
|
243
|
|
|
'prefix' => $assignedIssuesCount, |
|
244
|
|
|
]; |
|
245
|
|
|
} |
|
246
|
|
|
$tabs[] = [ |
|
247
|
|
|
'url' => $project->to('notes'), |
|
248
|
|
|
'page' => 'notes', |
|
249
|
|
|
'prefix' => $notesCount, |
|
250
|
|
|
]; |
|
251
|
|
|
|
|
252
|
|
|
return $tabs; |
|
253
|
|
|
} |
|
254
|
|
|
|
|
255
|
|
|
/** |
|
256
|
|
|
* Edit the project. |
|
257
|
|
|
* |
|
258
|
|
|
* @param Project $project |
|
259
|
|
|
* @param Form $form |
|
260
|
|
|
* |
|
261
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
262
|
|
|
*/ |
|
263
|
|
|
public function getEdit(ProjectRepository $project, Form $form) |
|
264
|
|
|
{ |
|
265
|
|
|
return view('project.edit', [ |
|
266
|
|
|
'form' => $form, |
|
267
|
|
|
'project' => $project, |
|
268
|
|
|
'sidebar' => 'project', |
|
269
|
|
|
]); |
|
270
|
|
|
} |
|
271
|
|
|
|
|
272
|
|
|
/** |
|
273
|
|
|
* To update project details. |
|
274
|
|
|
* |
|
275
|
|
|
* @param Project $project |
|
276
|
|
|
* @param FormRequest\Project $request |
|
277
|
|
|
* |
|
278
|
|
|
* @return \Illuminate\Http\RedirectResponse |
|
279
|
|
|
*/ |
|
280
|
|
|
public function postEdit(ProjectRepository $project, FormRequest\Project $request) |
|
281
|
|
|
{ |
|
282
|
|
|
// Delete the project |
|
283
|
|
|
if ($request->has('delete-project')) { |
|
284
|
|
|
$project->delete(); |
|
|
|
|
|
|
285
|
|
|
|
|
286
|
|
|
return redirect('projects') |
|
287
|
|
|
->with('notice', trans('tinyissue.project_has_been_deleted')); |
|
288
|
|
|
} |
|
289
|
|
|
|
|
290
|
|
|
$project->update($request->all()); |
|
|
|
|
|
|
291
|
|
|
|
|
292
|
|
|
return redirect($project->to()) |
|
|
|
|
|
|
293
|
|
|
->with('notice', trans('tinyissue.project_has_been_updated')); |
|
294
|
|
|
} |
|
295
|
|
|
|
|
296
|
|
|
/** |
|
297
|
|
|
* Ajax: returns list of users that are not in the project. |
|
298
|
|
|
* |
|
299
|
|
|
* @param Project $project |
|
300
|
|
|
* |
|
301
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
302
|
|
|
*/ |
|
303
|
|
|
public function getInactiveUsers(ProjectRepository $project) |
|
304
|
|
|
{ |
|
305
|
|
|
$users = $project->getNotMembers()->dropdown('fullname'); |
|
|
|
|
|
|
306
|
|
|
|
|
307
|
|
|
return response()->json($users); |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
/** |
|
311
|
|
|
* Ajax: add user to the project. |
|
312
|
|
|
* |
|
313
|
|
|
* @param Project $project |
|
314
|
|
|
* @param Request $request |
|
315
|
|
|
* |
|
316
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
317
|
|
|
*/ |
|
318
|
|
|
public function postAssign(ProjectRepository $project, Request $request) |
|
319
|
|
|
{ |
|
320
|
|
|
$status = $project->assignUser((int) $request->input('user_id')); |
|
|
|
|
|
|
321
|
|
|
|
|
322
|
|
|
return response()->json(['status' => (bool) $status]); |
|
323
|
|
|
} |
|
324
|
|
|
|
|
325
|
|
|
/** |
|
326
|
|
|
* Ajax: remove user from the project. |
|
327
|
|
|
* |
|
328
|
|
|
* @param Project $project |
|
329
|
|
|
* @param Request $request |
|
330
|
|
|
* |
|
331
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
332
|
|
|
*/ |
|
333
|
|
|
public function postUnassign(RoleRepository $project, Request $request) |
|
334
|
|
|
{ |
|
335
|
|
|
$status = $project->unassignUser((int) $request->input('user_id')); |
|
|
|
|
|
|
336
|
|
|
|
|
337
|
|
|
return response()->json(['status' => (bool) $status]); |
|
338
|
|
|
} |
|
339
|
|
|
|
|
340
|
|
|
/** |
|
341
|
|
|
* To add a new note to the project. |
|
342
|
|
|
* |
|
343
|
|
|
* @param Project $project |
|
344
|
|
|
* @param Note $note |
|
345
|
|
|
* @param FormRequest\Note $request |
|
346
|
|
|
* |
|
347
|
|
|
* @return \Illuminate\Http\RedirectResponse |
|
348
|
|
|
*/ |
|
349
|
|
|
public function postAddNote(ProjectRepository $project, NoteRepository $note, FormRequest\Note $request) |
|
350
|
|
|
{ |
|
351
|
|
|
$note->setRelation('project', $project); |
|
|
|
|
|
|
352
|
|
|
$note->setRelation('createdBy', $this->getLoggedUser()); |
|
|
|
|
|
|
353
|
|
|
$note->createNote($request->all()); |
|
|
|
|
|
|
354
|
|
|
|
|
355
|
|
|
return redirect($note->to())->with('notice', trans('tinyissue.your_note_added')); |
|
|
|
|
|
|
356
|
|
|
} |
|
357
|
|
|
|
|
358
|
|
|
/** |
|
359
|
|
|
* Ajax: To update project note. |
|
360
|
|
|
* |
|
361
|
|
|
* @param Project $project |
|
362
|
|
|
* @param Note $note |
|
363
|
|
|
* @param Request $request |
|
364
|
|
|
* |
|
365
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
366
|
|
|
*/ |
|
367
|
|
|
public function postEditNote(ProjectRepository $project, \Tinyissue\Contracts\Repository\Project\NoteRepository $note, Request $request) |
|
368
|
|
|
{ |
|
369
|
|
|
$body = ''; |
|
370
|
|
|
if ($request->has('body')) { |
|
371
|
|
|
$note->setRelation('project', $project); |
|
372
|
|
|
$note->updateBody($request->input('body'), $this->getLoggedUser()); |
|
373
|
|
|
|
|
374
|
|
|
$body = \Html::format($note->body); |
|
375
|
|
|
} |
|
376
|
|
|
|
|
377
|
|
|
return response()->json(['status' => true, 'text' => $body]); |
|
378
|
|
|
} |
|
379
|
|
|
|
|
380
|
|
|
/** |
|
381
|
|
|
* Ajax: to delete a project note. |
|
382
|
|
|
* |
|
383
|
|
|
* @param Project $project |
|
384
|
|
|
* @param Note $note |
|
385
|
|
|
* |
|
386
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
387
|
|
|
*/ |
|
388
|
|
|
public function getDeleteNote(ProjectRepository $project, \Tinyissue\Contracts\Repository\Project\NoteRepository $note) |
|
|
|
|
|
|
389
|
|
|
{ |
|
390
|
|
|
$note->deleteNote($this->getLoggedUser()); |
|
391
|
|
|
|
|
392
|
|
|
return response()->json(['status' => true]); |
|
393
|
|
|
} |
|
394
|
|
|
|
|
395
|
|
|
/** |
|
396
|
|
|
* Ajax: generate the issues export file. |
|
397
|
|
|
* |
|
398
|
|
|
* @param Project $project |
|
399
|
|
|
* @param Exporter $exporter |
|
400
|
|
|
* @param Request $request |
|
401
|
|
|
* |
|
402
|
|
|
* @return \Symfony\Component\HttpFoundation\Response |
|
403
|
|
|
*/ |
|
404
|
|
|
public function postExportIssues(ProjectRepository $project, Exporter $exporter, Request $request) |
|
405
|
|
|
{ |
|
406
|
|
|
// Generate export file |
|
407
|
|
|
$info = $exporter->exportFile( |
|
408
|
|
|
'Project\Issue', |
|
409
|
|
|
$request->input('format', Exporter::TYPE_CSV), |
|
|
|
|
|
|
410
|
|
|
$request->all() |
|
411
|
|
|
); |
|
412
|
|
|
|
|
413
|
|
|
// Download link |
|
414
|
|
|
$link = link_to( |
|
415
|
|
|
$project->to('download_export/' . $info['file']), |
|
|
|
|
|
|
416
|
|
|
trans('tinyissue.download_export'), |
|
|
|
|
|
|
417
|
|
|
['class' => 'btn btn-link'] |
|
418
|
|
|
); |
|
419
|
|
|
|
|
420
|
|
|
return response()->json([ |
|
421
|
|
|
'link' => $link, |
|
422
|
|
|
'title' => $info['title'], |
|
423
|
|
|
'file' => $info['file'], |
|
424
|
|
|
'ext' => $info['ext'], |
|
425
|
|
|
]); |
|
426
|
|
|
} |
|
427
|
|
|
|
|
428
|
|
|
/** |
|
429
|
|
|
* Download and then delete an export file. |
|
430
|
|
|
* |
|
431
|
|
|
* @param Project $project |
|
432
|
|
|
* @param string $file |
|
433
|
|
|
* |
|
434
|
|
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse |
|
435
|
|
|
*/ |
|
436
|
|
|
public function getDownloadExport(ProjectRepository $project, $file) |
|
|
|
|
|
|
437
|
|
|
{ |
|
438
|
|
|
// Filter out any characters that are not in pattern |
|
439
|
|
|
$file = preg_replace('/[^a-z0-9\_\.]/mi', '', $file); |
|
440
|
|
|
|
|
441
|
|
|
// Download export |
|
442
|
|
|
return response()->download(storage_path('exports/' . $file), $file)->deleteFileAfterSend(true); |
|
443
|
|
|
} |
|
444
|
|
|
} |
|
445
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.