- add deal category migration - add deals migration and model - add form to create deal - add image preview modal when uploading the image - refactor UI components to support `required` attribute - refactor input component to support description - fix some UI components does not support old values - fix some UI components does not show error messages
38 lines
1.7 KiB
PHP
38 lines
1.7 KiB
PHP
<x-layout title="Create a new deal">
|
|
<x-dashboard.page-heading
|
|
title="Create New Deal"
|
|
description="Share a new opportunity with the community"
|
|
:back-link="route('broker.dashboard')"
|
|
/>
|
|
<div class="flex items-center justify-center mt-8">
|
|
|
|
<x-dashboard.card class="w-8/12">
|
|
<h3 class="text-md font-bold">Deal Information</h3>
|
|
<form method="post" enctype="multipart/form-data" action="{{route('broker.deals.store')}}" class="flex flex-col space-y-8 mt-4">
|
|
@csrf
|
|
<x-ui.input name="title" label="Deal Title" required placeholder="e.g., Luxury Apartment Downtown"/>
|
|
|
|
<x-ui.select :options="$categories" name="deal_category_id" label-key="name" value-key="id" label="Category"
|
|
placeholder="Select a category" required/>
|
|
|
|
<x-ui.textarea name="description" label="Description" required
|
|
placeholder="Describe your deal in detail..."/>
|
|
|
|
<x-ui.image-input name="image" label="Upload image" allowed="jpg,png" size="10"/>
|
|
|
|
<x-ui.input
|
|
name="link"
|
|
label="External Link (Optional)"
|
|
placeholder="https://example.com"
|
|
description="Add a link to your website, listing page or contact form"
|
|
/>
|
|
|
|
<div class="grid grid-cols-12 w-full space-x-4">
|
|
<x-ui.button variant="neutral" class="col-span-10">Submit</x-ui.button>
|
|
<a href="{{route('broker.dashboard')}}" class="ui-btn border border-accent-600/20 col-span-2">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</x-dashboard.card>
|
|
</div>
|
|
</x-layout>
|