Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

ResourceMakeCommand

Ferdinand Frank edited this page Jan 31, 2019 · 3 revisions

Creates a new API resource class.

Usage

php artisan make:resource <name>

Arguments

Argument Description Note
name The name of the class Required

Options

Option Description Default
-c, --collection Create a resource collection
-h, --help Display a help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages

Stubs

This table gives you an overview when which stub file is used as a template to create the php file.

Stub Command Restriction
resource.stub Used when a class for a single resource shall be created
resource-collection.stub Used when a resource collection class shall be created, i.e., the -c option is specified or the name of the class ends with Collection
Clone this wiki locally