first commit
This commit is contained in:
41
resources/views/region/create.blade.php
Executable file
41
resources/views/region/create.blade.php
Executable file
@ -0,0 +1,41 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
<div class="container mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 margin-tb">
|
||||
<div class="pull-left mb-2">
|
||||
<h2>Add Region</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{{ route('regions.index') }}"> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success mb-1 mt-1">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{ route('regions.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Country id:</label>
|
||||
<select class="form-select mb-2" name="country_id">
|
||||
<option>Select Country</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{$country->id}}">{{$country->id}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('country_id')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary ml-3">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
44
resources/views/region/edit.blade.php
Executable file
44
resources/views/region/edit.blade.php
Executable file
@ -0,0 +1,44 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
<div class="container mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 margin-tb">
|
||||
<div class="pull-left">
|
||||
<h2>Edit Region</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{{ route('regions.index') }}" enctype="multipart/form-data">
|
||||
Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success mb-1 mt-1">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{ route('regions.update',$region->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Country id:</label>
|
||||
<select class="form-select mb-2" name="country_id">
|
||||
<option>Select Country</option>
|
||||
@foreach($countries as $country)
|
||||
<option value="{{$country->id}}" {{$country->id == $region->country_id ? 'selected' : ''}}>{{$country->id}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('country_id')
|
||||
<div class="alert alert-danger mt-1 mb-1">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary ml-3">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
50
resources/views/region/index.blade.php
Executable file
50
resources/views/region/index.blade.php
Executable file
@ -0,0 +1,50 @@
|
||||
@extends('layout.master')
|
||||
|
||||
@section('content')
|
||||
<div class="container mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 margin-tb">
|
||||
<div class="pull-left">
|
||||
<h2>Regions</h2>
|
||||
</div>
|
||||
<div class="pull-right mb-2">
|
||||
<a class="btn btn-success" href="{{ route('regions.create') }}"> Create Region</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Region id</th>
|
||||
<th>Country id</th>
|
||||
<th>Region created</th>
|
||||
<th>Region updated</th>
|
||||
<th width="280px">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($regions as $region)
|
||||
<tr>
|
||||
<td>{{ $region->id }}</td>
|
||||
<td>{{ $region->country_id }}</td>
|
||||
<td>{{ $region->created_at }}</td>
|
||||
<td>{{ $region->updated_at }}</td>
|
||||
<td>
|
||||
<form action="{{ route('regions.destroy',$region->id) }}" method="Post">
|
||||
<a class="btn btn-primary" href="{{ route('regions.edit',$region->id) }}">Edit</a>
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
Reference in New Issue
Block a user