]> BookStack Code Mirror - bookstack/blob - app/Exports/Controllers/ImportController.php
4270828effdcbe2fdf766bf744400de7ce645205
[bookstack] / app / Exports / Controllers / ImportController.php
1 <?php
2
3 namespace BookStack\Exports\Controllers;
4
5 use BookStack\Http\Controller;
6 use Illuminate\Http\Request;
7
8 class ImportController extends Controller
9 {
10     public function __construct()
11     {
12         $this->middleware('can:content-import');
13     }
14
15     public function start(Request $request)
16     {
17         // TODO - Show existing imports for user (or for all users if admin-level user)
18
19         return view('exports.import');
20     }
21
22     public function upload(Request $request)
23     {
24         $this->validate($request, [
25             'file' => ['required', 'file']
26         ]);
27
28         $file = $request->file('file');
29         $file->getRealPath();
30         // TODO - Read existing ZIP upload and send through validator
31             // TODO - If invalid, return user with errors
32         // TODO - Upload to storage
33         // TODO - Store info/results from validator
34         // TODO - Send user to next import stage
35     }
36 }