mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-22 18:20:31 -05:00
add missing parameters
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\TicketAttachment;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -32,13 +33,13 @@ class TicketAttachmentController extends Controller
|
||||
/**
|
||||
* Stores one or multiple ticket attachments from the ticket create form.
|
||||
*/
|
||||
public static function storeTicketAttachments(Request $request, $user, $ticket)
|
||||
public static function storeTicketAttachments(Request $request, Ticket $ticket, User $user): void
|
||||
{
|
||||
if(! $request->hasfile('attachment')) {
|
||||
if(! $request->hasfile('attachments')) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach($request->file('attachment') as $file)
|
||||
foreach($request->attachments as $file)
|
||||
{
|
||||
if ($file->getSize() > 1000000) {
|
||||
continue;
|
||||
|
||||
@@ -47,7 +47,7 @@ class TicketController extends Controller
|
||||
{
|
||||
$ticket = Ticket::create(['user_id' => $request->user()->id] + $request->validated());
|
||||
|
||||
TicketAttachmentController::storeTicketAttachments($request, $request->user(), $ticket);
|
||||
TicketAttachmentController::storeTicketAttachments($request, $ticket, $request->user());
|
||||
|
||||
return to_route('tickets.show', ['ticket' => $ticket])
|
||||
->withSuccess(trans('ticket.created-success'));
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<input
|
||||
id="attachments"
|
||||
type="file"
|
||||
name="attachment[]"
|
||||
name="attachments[]"
|
||||
class="upload-form-file form__file"
|
||||
multiple
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user