/home2/mshostin/crm.ms-hostingladz.com/resources/views/pages/departments/edit.blade.php
@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12 my-4">
                <div class="card shadow">
                    <div class="card-body">
                        <h1>Edit Department</h1>
                        <form action="{{ route('departments.update', $department->id) }}" method="POST">
                            @csrf
                            @method('PUT')
                            <div class="form-group">
                                <label for="search">Type</label>
                                <select class="form-control select2" name="comp_type_id" required>
                                    <option disabled selected> -- Select Type --</option>
                                    @foreach ($ct as $row)
                                        <option value="{{ $row->id }}" @if($row->id == $department->comp_type_id) selected @endif> {{ $row->title }} </option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="name">Name</label>
                                <input type="text" name="name" class="form-control" value="{{ $department->name }}"
                                    required>
                            </div>
                            <div class="form-group">
                                <label for="description">Description</label>
                                <textarea name="description" class="form-control">{{ $department->description }}</textarea>
                            </div>
                            <div class="form-group">
                                <label for="status">Status</label>
                                <select name="status" class="form-control">
                                    <option value="1" {{ $department->status ? 'selected' : '' }}>Active</option>
                                    <option value="0" {{ !$department->status ? 'selected' : '' }}>Inactive</option>
                                </select>
                            </div>
                            <button type="submit" class="btn btn-success">Update</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection