Search
 
SCRIPT & CODE EXAMPLE
 

PHP

apiresource laravel

Verb          Path                        Action  Route Name
GET           /users                      index   users.index
POST          /users                      store   users.store
GET           /users/{user}               show    users.show
PUT|PATCH     /users/{user}               update  users.update
DELETE        /users/{user}               destroy users.destroy
Comment

laravel apiresource

When declaring resource routes that will be consumed by APIs,
you will commonly want to exclude routes that present HTML
templates such as "create" and "edit"

//Route=>
use AppHttpControllersPhotoController;
Route::apiResource('photos', PhotoController::class);

//artisan command =>
php artisan make:controller PhotoController --api
  
Comment

laravel resource api

php artisan make:resource UserResource
php artisan make:resource User --collection 
php artisan make:resource UserCollection
Comment

laravel make api resource

php artisan make:resource User --collection

php artisan make:resource UserCollection
Comment

laravel apiresource

GET -	    "/photos/{photo}/comments" - index
GET -	    "/photos/{photo}/comments/create" - create
POST -	    "/photos/{photo}/comments" - store
GET -	    "/comments/{comment}" - show
GET -	    "/comments/{comment}/edit" - edit
PUT/PATCH -	"/comments/{comment}" - update
DELETE -	"/comments/{comment}" - destroy
Comment

laravel make apiResources

php artisan make:controller PhotoController --api
Comment

PREVIOUS NEXT
Code Example
Php :: php loop array 
Php :: yii2 clear schema cache 
Php :: SMTP - ERROR: Failed to connect to server: Connection refused (111)SMTP Connect() failed. 
Php :: laravel soft delete example 
Php :: php microtime to ms 
Php :: Diferencia entre dias PHP 
Php :: Proc file for laravel 
Php :: php define multiple variables as 0 
Php :: how to print string plus variable in php 
Php :: how to get http parameters in php 
Php :: php remove non utf-8 characters 
Php :: install phpmyadmin on vagrant homestead on mac 
Php :: Laravel - Query Builder Raw Query selectRaw 
Php :: laravel log reader 
Php :: new session php 
Php :: wp php go back 
Php :: php-fpm docker 
Php :: how to get structure of table in codeigniter 
Php :: array search multidimensional php 
Php :: rename migration laravel 
Php :: @foreac laravel 
Php :: php sort multidimensional array by key 
Php :: get all post 
Php :: laravel echo html 
Php :: get filesize php 
Php :: laravel attach 
Php :: insert batch in laravel 
Php :: parsing html in php 
Php :: quitar guiones en string php 
Php :: laravel route required parameters 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =