Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @extends('admin.admin_master')
- @section('admin')
- <div class="py-12">
- <div class="container">
- <div class="row">
- <div class="col-xl-8 col-lg-8 col-md-8">
- <div class="card text-center">
- <div class="card-header">All Brands</div>
- <table class="table">
- <thead>
- <tr>
- <th scope="col">#</th>
- <th scope="col">Brand Name</th>
- <th scope="col">Brand Image</th>
- <th scope="col">Created At</th>
- <th colspan="2" scope="col">Action</th>
- </tr>
- </thead>
- <tbody>
- @if (count($brands))
- @foreach ($brands as $key => $brand)
- <tr>
- <td>{{ $brands->firstItem() + $loop->index }}</td>
- <td>{{ $brand->brand_name }}</td>
- <td>
- <img src="{{ asset('image/brand') }}/{{ $brand->brand_image }}" width="70px" alt="" srcset="">
- </td>
- <td>
- @if ($brand->created_at == NULL )
- <span>No Date set</span>
- @else
- <span>{{ Carbon\Carbon::parse($brand->created_at)->diffForHumans() }}</span>
- @endif
- </td>
- <td><a href="{{ route('edit.brands', [$brand->id]) }}" class="btn btn-info">Edit</a></td>
- <td>
- <form action="{{ route('delete.brand', [$brand->id]) }}" method="POST">@csrf
- @method('DELETE')
- <button type="submit" class="btn btn-danger">Delete</button>
- </form>
- </td>
- @endforeach
- </tr>
- @else
- <tr>
- <td colspan="6">No Brands Added yet</td>
- </tr>
- @endif
- </tbody>
- </table>
- </div>
- </div>
- <div class="col-xl-4 col-lg-4 col-md-4">
- <div class="card">
- <div class="card-header">Add Brand</div>
- <div class="card-body">
- <form action="{{ route('add.brand') }}" method="post" enctype="multipart/form-data">
- @csrf
- <div class="form-group">
- <label for="">Brand Name</label>
- <input class="form-control @error('brand_name') is-invalid @enderror" type="text" name="brand_name" placeholder="Type the brand name">
- @error('brand_name')
- <span class="text-danger">{{ $message }}</span>
- @enderror
- </div>
- <div class="form-group">
- <label for="">Brand Image</label>
- <input class="form-control @error('brand_image') is-invalid @enderror" type="file" name="brand_image" placeholder="upload the brand image">
- @error('brand_image')
- <span class="text-danger">{{ $message }}</span>
- @enderror
- </div>
- <button class="btn btn-primary form-control" type="submit">Add Brand</button>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- {{-- Trashed --}}
- </div>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement