“Rute Sumber Daya Laravel” Kode Jawaban

Rute Sumber Daya Laravel

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 membuat pengontrol sumber daya

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

cara bernama rute sumber daya laravel

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

Pengontrol Rute Sumber Daya 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

Rute Sumber Daya Laravel

<?php

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

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

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

Rute Sumber Daya Laravel 8

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

Jawaban yang mirip dengan “Rute Sumber Daya Laravel”

Pertanyaan yang mirip dengan “Rute Sumber Daya Laravel”

Lebih banyak jawaban terkait untuk “Rute Sumber Daya Laravel” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya