mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 15:16:51 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			886 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			886 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/**
 | 
						|
 * Pterodactyl - Panel
 | 
						|
 * Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
 | 
						|
 *
 | 
						|
 * This software is licensed under the terms of the MIT license.
 | 
						|
 * https://opensource.org/licenses/MIT
 | 
						|
 */
 | 
						|
 | 
						|
namespace Pterodactyl\Http\Requests;
 | 
						|
 | 
						|
use Illuminate\Foundation\Http\FormRequest;
 | 
						|
 | 
						|
abstract class FrontendUserFormRequest extends FormRequest
 | 
						|
{
 | 
						|
    abstract public function rules();
 | 
						|
 | 
						|
    /**
 | 
						|
     * Determine if a user is authorized to access this endpoint.
 | 
						|
     *
 | 
						|
     * @return bool
 | 
						|
     */
 | 
						|
    public function authorize()
 | 
						|
    {
 | 
						|
        return ! is_null($this->user());
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Return only the fields that we are interested in from the request.
 | 
						|
     * This will include empty fields as a null value.
 | 
						|
     *
 | 
						|
     * @return array
 | 
						|
     */
 | 
						|
    public function normalize()
 | 
						|
    {
 | 
						|
        return $this->only(
 | 
						|
            array_keys($this->rules())
 | 
						|
        );
 | 
						|
    }
 | 
						|
}
 |