PHP Класс App\Http\Controllers\ProductsController

Наследование: extends Controller
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
changeStatus ( integer $id ) : Response Change status a Product.
create ( ) : Response Show the form for creating a new resource.
deleteImg ( Illuminate\Http\Request $request ) : string delete image file.
destroy ( integer $id ) : Response Remove the specified resource from storage.
downloadExample ( ) : string dowload file txt example.
edit ( integer $id ) : Response Show the form for editing the specified resource.
getFeatures ( array $data = [] ) : [type] getFeatures Allows consulting products features. It can return either a required feature or a full array.
getRandCategoryId ( ) : [integer] To get a existing category id from products.
getSuggestions ( $data ) : [array] To get the products suggestion, taking in account either the preference key, such as (product_viewed, product_purchased, product_shared, product_categories, my_searches), or all of them.
getTagsCategories ( $tags = [] ) : [array] Get the category id from tags array.
getTopRated ( [integer] $point = '5', [integer] $limit = 5, [boolean] $tags = false ) : [array This method is able to return the higher rate product list, everything will depends of $point parameter.
index ( Illuminate\Http\Request $request ) : Response Display a listing of the resource.
myProducts ( Illuminate\Http\Request $request )
searchAll ( Illuminate\Http\Request $request ) : [type] [Search products in auto complete fields].
setCounters ( [object] $product = null, [array] $data = [], [string] $wrapper = '' ) Increase the product counters.
show ( integer $id ) : Response Display the specified resource.
store ( Illuminate\Http\Request $request ) : Response Store a newly created resource in storage.
update ( integer $id, Illuminate\Http\Request $request ) : Response Update the specified resource in storage.
upload ( Illuminate\Http\Request $request ) : string upload image file.
upload_key ( Illuminate\Http\Request $request ) : string upload the keys file in txt format.
upload_software ( Illuminate\Http\Request $request ) : string upload the software file in txt format.

Приватные методы

Метод Описание
rulesByTypes ( $request, $edit = false )
validateFeatures ( [array] $data ) : [string | array] validate product feature, as specified in the table of product details.
validationMessagesFeatures ( [string] $rules, [string] $index, [string] $name ) : [array] create the error message by taking the name feature, and validation rules.

Описание методов

changeStatus() публичный Метод

Change status a Product.
public changeStatus ( integer $id ) : Response
$id integer
Результат Response

create() публичный Метод

Show the form for creating a new resource.
public create ( ) : Response
Результат Response

deleteImg() публичный Метод

@param Resquest file to upload
public deleteImg ( Illuminate\Http\Request $request ) : string
$request Illuminate\Http\Request
Результат string

destroy() публичный Метод

Remove the specified resource from storage.
public destroy ( integer $id ) : Response
$id integer
Результат Response

downloadExample() публичный Метод

@param Resquest file to upload
public downloadExample ( ) : string
Результат string

edit() публичный Метод

Show the form for editing the specified resource.
public edit ( integer $id ) : Response
$id integer
Результат Response

getFeatures() публичный Метод

getFeatures Allows consulting products features. It can return either a required feature or a full array.
public getFeatures ( array $data = [] ) : [type]
$data array function setting
Результат [type]

getRandCategoryId() публичный статический Метод

To get a existing category id from products.
public static getRandCategoryId ( ) : [integer]
Результат [integer]

getSuggestions() публичный статический Метод

To get the products suggestion, taking in account either the preference key, such as (product_viewed, product_purchased, product_shared, product_categories, my_searches), or all of them.
public static getSuggestions ( $data ) : [array]
Результат [array]

getTagsCategories() публичный статический Метод

Get the category id from tags array.
public static getTagsCategories ( $tags = [] ) : [array]
Результат [array]

getTopRated() публичный статический Метод

This method is able to return the higher rate product list, everything will depends of $point parameter.
public static getTopRated ( [integer] $point = '5', [integer] $limit = 5, [boolean] $tags = false ) : [array
$point [integer]
$limit [integer]
$tags [boolean]
Результат [array

index() публичный Метод

Display a listing of the resource.
public index ( Illuminate\Http\Request $request ) : Response
$request Illuminate\Http\Request
Результат Response

myProducts() публичный Метод

public myProducts ( Illuminate\Http\Request $request )
$request Illuminate\Http\Request

searchAll() публичный Метод

[Search products in auto complete fields].
public searchAll ( Illuminate\Http\Request $request ) : [type]
$request Illuminate\Http\Request [Request laravel]
Результат [type]

setCounters() публичный статический Метод

Increase the product counters.
public static setCounters ( [object] $product = null, [array] $data = [], [string] $wrapper = '' )
$product [object]
$data [array]
$wrapper [string]

show() публичный Метод

Display the specified resource.
public show ( integer $id ) : Response
$id integer
Результат Response

store() публичный Метод

Store a newly created resource in storage.
public store ( Illuminate\Http\Request $request ) : Response
$request Illuminate\Http\Request
Результат Response

update() публичный Метод

Update the specified resource in storage.
public update ( integer $id, Illuminate\Http\Request $request ) : Response
$id integer
$request Illuminate\Http\Request
Результат Response

upload() публичный Метод

@param Resquest file to upload
public upload ( Illuminate\Http\Request $request ) : string
$request Illuminate\Http\Request
Результат string

upload_key() публичный Метод

@param Resquest file to upload
public upload_key ( Illuminate\Http\Request $request ) : string
$request Illuminate\Http\Request
Результат string

upload_software() публичный Метод

@param Resquest file to upload
public upload_software ( Illuminate\Http\Request $request ) : string
$request Illuminate\Http\Request
Результат string