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

Revision

Revision 64 | 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 [
58 lars 32
                "only_deliverable" => "required|int|in:0,1",
33
                "status"           => "required|int|in:0,1",
53 lars 34
                "min_price"        => "decimal:0,2",
35
                "contact_name"     => "sometimes|max:255",
36
                "contact_email"    => "sometimes|max:255",
37
                "contact_phone"    => "sometimes|max:255",
38
                "access_url"       => "sometimes|max:255",
39
                "access_user"      => "sometimes||max:255",
40
                "access_password"  => "sometimes|max:255",
65 lars 41
                "comment"          => "sometimes",
42
                "comment2"         => "sometimes",
48 lars 43
                //
44
            ];
45
        }
54 lars 46
 
47
        protected function passedValidation()
48
        {
49
            if ( is_null( $this->access_url ) )
50
            {
51
                $this->access_url = "";
52
            }
53
            if ( is_null( $this->access_user ) )
54
            {
55
                $this->access_user = "";
56
            }
57
            if ( is_null( $this->access_password ) )
58
            {
59
                $this->access_password = "";
60
            }
61
        }
47 lars 62
    }