mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 11:06:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			47 lines
		
	
	
		
			978 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			978 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Pterodactyl\Http\Controllers\Api\Application\Locations;
 | 
						|
 | 
						|
use Pterodactyl\Models\Location;
 | 
						|
use Pterodactyl\Services\Acl\Api\AdminAcl;
 | 
						|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
 | 
						|
 | 
						|
class StoreLocationRequest extends ApplicationApiRequest
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @var string
 | 
						|
     */
 | 
						|
    protected $resource = AdminAcl::RESOURCE_LOCATIONS;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @var int
 | 
						|
     */
 | 
						|
    protected $permission = AdminAcl::WRITE;
 | 
						|
 | 
						|
    /**
 | 
						|
     * Rules to validate the request against.
 | 
						|
     *
 | 
						|
     * @return array
 | 
						|
     */
 | 
						|
    public function rules(): array
 | 
						|
    {
 | 
						|
        return collect(Location::getCreateRules())->only([
 | 
						|
            'long',
 | 
						|
            'short',
 | 
						|
        ])->toArray();
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Rename fields to be more clear in error messages.
 | 
						|
     *
 | 
						|
     * @return array
 | 
						|
     */
 | 
						|
    public function attributes()
 | 
						|
    {
 | 
						|
        return [
 | 
						|
            'long' => 'Location Description',
 | 
						|
            'short' => 'Location Identifier',
 | 
						|
        ];
 | 
						|
    }
 | 
						|
}
 |