mirror of
				https://github.com/opensupports/opensupports.git
				synced 2025-11-04 13:34:10 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			851 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			851 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
use Respect\Validation\Validator as DataValidator;
 | 
						|
 | 
						|
/**
 | 
						|
 * @api {post} /system/get-custom-fields Get custom fields
 | 
						|
 * @apiVersion 4.8.0
 | 
						|
 *
 | 
						|
 * @apiName Get all Custom field items
 | 
						|
 *
 | 
						|
 * @apiGroup System
 | 
						|
 *
 | 
						|
 * @apiDescription This path retrieves the all CustomField items.
 | 
						|
 *
 | 
						|
 * @apiPermission any
 | 
						|
 *
 | 
						|
 * @apiUse NO_PERMISSION
 | 
						|
 *
 | 
						|
 * @apiSuccess {[Customfield](#api-Data_Structures-ObjectCustomfield)[]} data Array of Customfield
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
class GetCustomFieldsController extends Controller {
 | 
						|
    const PATH = '/get-custom-fields';
 | 
						|
    const METHOD = 'POST';
 | 
						|
 | 
						|
    public function validations() {
 | 
						|
        return [
 | 
						|
            'permission' => 'any',
 | 
						|
            'requestData' => []
 | 
						|
        ];
 | 
						|
    }
 | 
						|
 | 
						|
    public function handler() {
 | 
						|
        $customFieldList = Customfield::getAll();
 | 
						|
 | 
						|
        Response::respondSuccess($customFieldList->toArray());
 | 
						|
    }
 | 
						|
}
 |