Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 53 | Revision 58 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
47 lars 1
<?php
2
 
48 lars 3
    namespace App\Http\Requests;
47 lars 4
 
48 lars 5
    use Illuminate\Foundation\Http\FormRequest;
47 lars 6
 
48 lars 7
    class PriceAgencyRequest extends FormRequest
47 lars 8
    {
48 lars 9
        /**
10
         * Determine if the user is authorized to make this request.
11
         *
12
         * @return bool
13
         */
14
        public function authorize()
15
        {
16
            if ( isset( $GLOBALS["user_rechte"]["marketing"]["preisagenturen"]["preisagenturen"] ) )
17
            {
18
                return true;
19
            }
47 lars 20
 
48 lars 21
            return false;
22
        }
23
 
24
        /**
25
         * Get the validation rules that apply to the request.
26
         *
27
         * @return array<string, mixed>
28
         */
29
        public function rules()
30
        {
31
            return [
53 lars 32
                "only_deliverable" => "required|int|max:1|min:0",
33
                "min_price"        => "decimal:0,2",
34
                "contact_name"     => "sometimes|max:255",
35
                "contact_email"    => "sometimes|max:255",
36
                "contact_phone"    => "sometimes|max:255",
37
                "access_url"       => "sometimes|max:255",
38
                "access_user"      => "sometimes||max:255",
39
                "access_password"  => "sometimes|max:255",
40
                "comment"          => "sometimes",
48 lars 41
                //
42
            ];
43
        }
54 lars 44
 
45
        protected function passedValidation()
46
        {
47
            if ( is_null( $this->access_url ) )
48
            {
49
                $this->access_url = "";
50
            }
51
            if ( is_null( $this->access_user ) )
52
            {
53
                $this->access_user = "";
54
            }
55
            if ( is_null( $this->access_password ) )
56
            {
57
                $this->access_password = "";
58
            }
59
        }
47 lars 60
    }