Skip to content

Commit

Permalink
Fix file
Browse files Browse the repository at this point in the history
  • Loading branch information
wdda committed Mar 20, 2023
1 parent 787c27d commit 8d54f74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/Http/Controllers/Resources/FilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public function index(Request $request): View|Factory|Redirector|Application|Red
return view('resources.files.index', Files::getListData($request->all()));
}

public function create(): Factory|View|Application
public function create(Request $request): Factory|View|Application
{
$folders = Files::getFoldersForSelect();
return view('resources.files.create', compact('folders'));
$folder = $request->get('folder');

return view('resources.files.create', compact('folder','folders'));
}

/**
Expand All @@ -49,7 +51,7 @@ public function store(Request $request): Redirector|RedirectResponse|Application
$create = Files::create($folder, $file, $request->get('file_name_in_game'));

if (!$create['error']) {
return redirect(route('files.index', compact('folder')))
return redirect(route('files.create', compact('folder')))
->with('message', 'File created');
}

Expand Down

0 comments on commit 8d54f74

Please sign in to comment.