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

<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class BucketController extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
/**
*
*
* @return
*
*/
public function single()
{
return view('bucket.single');
}
/**
*
*
* @return [type] [description]
*
*/
public function create()
{
return view('bucket.create');
}
/**
*
*
*/
public function store()
{
$validated = request()->validate([
'name' => 'required|max:255',
'description' => 'max:255',
'path' => 'present',
'is_public' => 'boolean',
]);
if ($validated) {
$bucket = Bucket::create($validated);
return redirect()
->route('bucket.single', ['uuid' => 12]);
} else {
return back()
->withInput();
}
}
}