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

Revision

Revision 155 | Revision 159 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php

    namespace App\Http\Requests;

    use Illuminate\Foundation\Http\FormRequest;

    class StoreSupplierRequest extends FormRequest
    {
        /**
         * Determine if the user is authorized to make this request.
         *
         * @return bool
         */
        public function authorize(): bool
        {
            if ( isset( $GLOBALS["user_rechte"]["bestellwesen"]["lieferanten"] ) )
            {
                return true;
            }
            return false;
        }

        /**
         * Get the validation rules that apply to the request.
         *
         * @return array<string, mixed>
         */
        public function rules(): array
        {
            return [
                //
                "name"             => "required",
                "name2"            => "sometimes",
                "rank"             => "sometimes|integer",
                "contact"          => "sometimes",
                "street"           => "sometimes",
                "houseno"          => "sometimes",
                "zip"              => "sometimes",
                "city"             => "sometimes",
                "phone"            => "sometimes",
                "fax"              => "sometimes",
                "email"            => "sometimes|email",
                "customer_no"      => "sometimes",
                "shipping_hint"    => "sometimes",
                "payment_hint"     => "sometimes",
                "common"           => "sometimes",
                "script"           => "sometimes",
                "stock_script"     => "sometimes",
                "interval"         => "sometimes",
                "accounts_payable" => "sometimes",
                "ledger_account"   => "sometimes",
            ];
        }
    }