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

Revision

Revision 54 | Revision 64 | 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 [
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",
41
                "comment"          => "sometimes",
48 lars 42
                //
43
            ];
44
        }
54 lars 45
 
46
        protected function passedValidation()
47
        {
48
            if ( is_null( $this->access_url ) )
49
            {
50
                $this->access_url = "";
51
            }
52
            if ( is_null( $this->access_user ) )
53
            {
54
                $this->access_user = "";
55
            }
56
            if ( is_null( $this->access_password ) )
57
            {
58
                $this->access_password = "";
59
            }
60
        }
47 lars 61
    }