@extends('admin.layouts.dashboard') @php $title = "Add Offer"; $button_text = "Submit"; if(!empty($offer)) { $title = "Edit Offer"; $button_text = "Update"; } @endphp @section('title', 'All Users') @section('content')

{{ $title }}

@if(!empty($offer))
@method('put') @else @endif @csrf @if(Session::has('failure'))
{{Session::get('failure')}}
@endif @if(Session::has('success'))
{{Session::get('success')}}
@endif
item_id)) checked @endif @if(Session::has('item_id')) checked @endif>

category_id)) checked @endif @if(Session::has('category_id')) checked @endif>
user_id)) checked @endif @if(Session::has('user_id')) checked @endif>
limit)) checked @endif @if(Session::has('limit')) checked @endif>

@php if(!empty($offer)){ if(Str::contains($offer->limit, '-')){ $limit = collect(explode('-', $offer->limit))->filter()->unique()->toArray(); } } @endphp
limit)) value="{{ Str::contains($offer->limit, '-') ? $limit[0] : $offer->limit }}" @endif>
limit)) value="{{ Str::contains($offer->limit, '-') ? $limit[1] : "" }}" @endif oninput="checkRange(this.value)">
name)) value="{{$offer->name}}" @endif @if(Session::has('name')) value="{{Session::get('name')}}" @endif required>
code)) value="{{$offer->code}}" @endif @if(Session::has('code')) value="{{Session::get('code')}}" @endif required>
amount)) value="{{$offer->amount}}" @endif @if(Session::has('amount')) value="{{Session::get('amount')}}" @endif required>
{{--
--}}
@endsection