mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
Including messages on registering and invalid product
This commit is contained in:
@@ -72,6 +72,8 @@ class RegisterController extends Controller
|
||||
|
||||
\Mail::to($user)->send(new Welcome($user));
|
||||
|
||||
session()->flash('primary', 'Thanks for registering. Please, do not forget to validate your e-mail address.');
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class ProductController extends Controller
|
||||
|
||||
/**
|
||||
* Stores the included product into database
|
||||
*
|
||||
*
|
||||
* @return (view) The product view
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -29,7 +29,7 @@ class ProductController extends Controller
|
||||
|
||||
/**
|
||||
* Delete a specified Product
|
||||
*
|
||||
*
|
||||
* @param (int) $id The product id
|
||||
*/
|
||||
public function delete(Request $request)
|
||||
@@ -55,14 +55,14 @@ class ProductController extends Controller
|
||||
$product->name = request('name');
|
||||
$product->url = request('url');
|
||||
$product->save();
|
||||
return redirect('product/'.request('product'));
|
||||
return redirect('product/' . request('product'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a specified Product
|
||||
*
|
||||
*
|
||||
* @param (int) $id The product id
|
||||
*
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
@@ -70,8 +70,8 @@ class ProductController extends Controller
|
||||
$product = Product::fromAuthUser()->find($id);
|
||||
|
||||
if (!$product) {
|
||||
session()->flash('danger', "The product doesn't exist or doesn't belongs to you.");
|
||||
return back();
|
||||
|
||||
}
|
||||
return view('product.show', compact('product'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user