forked from eatvio/eatvio-infra
static analisys refactoryn, View types added
This commit is contained in:
@@ -3,35 +3,22 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Recipe;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
|
||||
class RecipeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
public function index(): View|ViewFactory
|
||||
{
|
||||
return view('recipe/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
public function create(): View|ViewFactory
|
||||
{
|
||||
return view('recipe/edit_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Recipe $recipe)
|
||||
public function show(Recipe $recipe): View|ViewFactory
|
||||
{
|
||||
$data = [
|
||||
'author' => $recipe->author()->first(),
|
||||
@@ -48,12 +35,7 @@ class RecipeController extends Controller
|
||||
return view('recipe/show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Recipe $recipe)
|
||||
public function edit(Recipe $recipe): View|ViewFactory
|
||||
{
|
||||
return view('recipe/edit_form', ['recipe' => $recipe]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user