انتقل إلى المحتوى
الأدلة
التنقل
التنبيهات
الطبقات العائمة
التخطيط
عرض البيانات
النماذج
.md

التواصل

contact-07

عمودان: عنوان ونموذج تواصل قصير، وبجانبهما صورة طويلة.

فتح بملء الشاشة

التثبيت

php artisan ui:add-block contact-07

أمر واحد يثبّت ملف Blade الخاص بالقالب وكل مكوّن يعتمد عليه. اعرضه في تخطيطك كالتالي <x-ui.blocks.contact-07 />.

المكونات المضمّنة

الاستخدام

Every piece of content is a prop, so you can drive this block from a CMS. A field is ['name' =>, 'label' =>, 'type' =>, 'placeholder' =>, 'required' =>, 'width' =>, 'options' =>]. type is text, email, tel, textarea, select or radio (any other value is passed to the input as its type). width is full (default), half (half width at every size) or md:half (full on phones, half from md up). select and radio read 'options': plain strings or ['label' => ..., 'value' => ...]. Pass :terms="false" to drop the checkbox. method can be GET, POST, PUT, PATCH or DELETE; a @csrf field is added for anything but GET unless you pass :csrf="false".

<x-ui.blocks.contact-07
    tagline="Support"
    heading="Get in touch"
    description="We reply within one working day."
    :action="route('contact.store')"
    :image="['src' => asset('img/office.jpg'), 'alt' => 'Our office']"
    :fields="[
        ['name' => 'name', 'label' => 'Your name', 'required' => true],
        ['name' => 'email', 'label' => 'Email', 'type' => 'email', 'required' => true],
        ['name' => 'message', 'label' => 'How can we help?', 'type' => 'textarea', 'placeholder' => 'Tell us a little about it'],
    ]"
    terms="I agree to the"
    :terms-link="['label' => 'privacy policy', 'href' => '/privacy']"
    submit-label="Send message"
/>

الخصائص

كل خاصية مع قيمتها الافتراضية. مرّر أيًّا منها كسمة، واستخدم : لربط قيمة PHP.

@props([
    'tagline' => 'Tagline',
    'heading' => 'Contact us',
    'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
    'action' => '#',
    'method' => 'POST',
    'csrf' => true,
    'fields' => [
        ['name' => 'name', 'label' => 'Name', 'type' => 'text', 'required' => true],
        ['name' => 'email', 'label' => 'Email', 'type' => 'email', 'required' => true],
        [
            'name' => 'message',
            'label' => 'Message',
            'type' => 'textarea',
            'placeholder' => 'Type your message...',
            'required' => true,
        ],
    ],
    'terms' => 'I accept the',
    'termsLink' => ['label' => 'Terms', 'href' => '#'],
    'submitLabel' => 'Submit',
    'image' => ['src' => null, 'alt' => ''],
])