class React

Contains functions that perform operations for React.js relate CLI commands.

Constants

COMPONENT_PATH

Path to React.js components.

PAGE_PATH

Path to React.js pages.

UTILS_PATH

Path to JavaScript utilities.

Methods

static int
authComponents()

Generates the auth jsx components.

static string
defaultComponentTemplate(string $componentName)

Generates a component with default export.

static int
errorNotFoundComponent()

Generates the error/NotFound.jsx component.

static int
homeComponent()

Generates the home/Index.jsx component.

static string
namedComponentTemplate(string $componentName)

Generates a named export component.

static int
makeComponent(string $componentName, bool $named = false)

Generates component under 'resources/js/components'.

static int
makePage(string $filePath, string $pageName, bool $named = false)

Generates a page view component under 'resources/js/pages/'.

static int
makeUtility(string $utilityName)

Generates a JavaScript file under 'resources/js/utils' to be use as support file with React.js front-end.

static int
profileComponents()

Generates the profile jsx components.

Details

at line 33
static int authComponents()

Generates the auth jsx components.

Return Value

int

A value that indicates success, invalid, or failure.

at line 48
static string defaultComponentTemplate(string $componentName)

Generates a component with default export.

Parameters

string $componentName

The name of the component.

Return Value

string

The contents of the component.

at line 68
static int errorNotFoundComponent()

Generates the error/NotFound.jsx component.

Return Value

int

A value that indicates success, invalid, or failure.

at line 80
static int homeComponent()

Generates the home/Index.jsx component.

Return Value

int

A value that indicates success, invalid, or failure.

at line 93
static string namedComponentTemplate(string $componentName)

Generates a named export component.

Parameters

string $componentName

The name of the component.

Return Value

string

The contents of the component.

at line 115
static int makeComponent(string $componentName, bool $named = false)

Generates component under 'resources/js/components'.

Parameters

string $componentName

The name of the component.

bool $named

Boolean flag to determine if named or default component is generated.

Return Value

int

A value that indicates success, invalid, or failure.

at line 133
static int makePage(string $filePath, string $pageName, bool $named = false)

Generates a page view component under 'resources/js/pages/'.

Parameters

string $filePath

Full path for new page component.

string $pageName

Name of the page component.

bool $named

Boolean flag to determine if named or default component is generated.

Return Value

int

A value that indicates success, invalid, or failure.

at line 148
static int makeUtility(string $utilityName)

Generates a JavaScript file under 'resources/js/utils' to be use as support file with React.js front-end.

Parameters

string $utilityName

The name of the utility file.

Return Value

int

A value that indicates success, invalid, or failure.

at line 159
static int profileComponents()

Generates the profile jsx components.

Return Value

int

A value that indicates success, invalid, or failure.