You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  4. use Illuminate\Foundation\Bus\DispatchesJobs;
  5. use Illuminate\Foundation\Validation\ValidatesRequests;
  6. use Illuminate\Routing\Controller as BaseController;
  7. class BucketController extends BaseController
  8. {
  9. use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
  10. /**
  11. *
  12. *
  13. * @return
  14. *
  15. */
  16. public function single()
  17. {
  18. return view('bucket.single');
  19. }
  20. /**
  21. *
  22. *
  23. * @return [type] [description]
  24. *
  25. */
  26. public function create()
  27. {
  28. return view('bucket.create');
  29. }
  30. /**
  31. *
  32. *
  33. */
  34. public function store()
  35. {
  36. $validated = request()->validate([
  37. 'name' => 'required|max:255',
  38. 'description' => 'max:255',
  39. 'path' => 'present',
  40. 'is_public' => 'boolean',
  41. ]);
  42. if ($validated) {
  43. $bucket = Bucket::create($validated);
  44. return redirect()
  45. ->route('bucket.single', ['uuid' => 12]);
  46. } else {
  47. return back()
  48. ->withInput();
  49. }
  50. }
  51. }