“Ларавел ресурсный маршрут” Ответ

Ларавел ресурсный маршрут

use App\Http\Controllers\PhotoController;

Route::resource('photos', PhotoController::class)->only([
    'index', 'show'
]);

Route::resource('photos', PhotoController::class)->except([
    'create', 'store', 'update', 'destroy'
]);
Mohamad

Laravel Create Resource Controller

php artisan make:controller PhotoController --resource --model=Photo
Leonardo Dal Ronco

Как назвать Route Resource Laravel

Route::resource('faq', 'ProductFaqController', [
    'names' => [
        'index' => 'faq',
        'store' => 'faq.new',
        // etc...
    ]
]);
yusuf_fazeri

Контроллер маршрута ресурса Laravel 8

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class BlogController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}
Angry Ape

Ресурсный маршрут Ларавел

<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ProductController;

Route::get('/', function () {
    return view('welcome');
});

Route::resource('product',ProductController::class);
Strange Shark

Ресурсный маршрут Laravel 8

use App\Http\Controllers\BlogController;
Route::resource('blogs', BlogController::class);
Angry Ape

Ответы похожие на “Ларавел ресурсный маршрут”

Вопросы похожие на “Ларавел ресурсный маршрут”

Больше похожих ответов на “Ларавел ресурсный маршрут” по PHP

Смотреть популярные ответы по языку

Смотреть другие языки программирования