master

laravel/framework

Last updated at: 28/12/2023 01:39

controller.model.api.stub

TLDR

This file is a stub file that serves as a template for creating a controller class in the Illuminate/Routing/Console/stubs directory. It includes methods for displaying a listing of the resource, storing a newly created resource in storage, displaying a specific resource, updating a resource in storage, and removing a resource from storage.

Methods

index

This method is responsible for displaying a listing of the resource. No specific functionality is provided in this method.

store

This method is responsible for storing a newly created resource in storage. It expects a storeRequest parameter, which represents the request for storing the resource. No specific functionality is provided in this method.

show

This method is responsible for displaying a specific resource. It expects a model parameter and uses the $modelVariable as the variable name for the resource. No specific functionality is provided in this method.

update

This method is responsible for updating a resource in storage. It expects an updateRequest parameter, which represents the request for updating the resource, and a model parameter which represents the resource to be updated. No specific functionality is provided in this method.

destroy

This method is responsible for removing a specific resource from storage. It expects a model parameter and uses the $modelVariable as the variable name for the resource. No specific functionality is provided in this method.

<?php

namespace {{ namespace }};

use {{ namespacedModel }};
use {{ rootNamespace }}Http\Controllers\Controller;
use {{ namespacedRequests }}

class {{ class }} extends Controller
{
    /**
     * Display a listing of the resource.
     */
    public function index()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     */
    public function store({{ storeRequest }} $request)
    {
        //
    }

    /**
     * Display the specified resource.
     */
    public function show({{ model }} ${{ modelVariable }})
    {
        //
    }

    /**
     * Update the specified resource in storage.
     */
    public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }})
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy({{ model }} ${{ modelVariable }})
    {
        //
    }
}