ui
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<!-- create.blade.php -->
|
||||
|
||||
@extends('layout')
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
.uper {
|
||||
margin-top: 40px;
|
||||
}
|
||||
</style>
|
||||
<div class="card uper">
|
||||
<div class="card-header">
|
||||
Add Games Data
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div><br />
|
||||
@endif
|
||||
<form method="post" action="{{ route('games.store') }}">
|
||||
<div class="form-group">
|
||||
@csrf
|
||||
<label for="country_name">Game Name:</label>
|
||||
<input type="text" class="form-control" name="name"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cases">Price :</label>
|
||||
<input type="text" class="form-control" name="price"/>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Add Game</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,38 @@
|
||||
@extends('layout')
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
.uper {
|
||||
margin-top: 40px;
|
||||
}
|
||||
</style>
|
||||
<div class="card uper">
|
||||
<div class="card-header">
|
||||
Edit Game Data
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div><br />
|
||||
@endif
|
||||
<form method="post" action="{{ route('games.update', $game->id ) }}">
|
||||
<div class="form-group">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<label for="country_name">Game Name:</label>
|
||||
<input type="text" class="form-control" name="name" value="{{ $game->name }}"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cases">Game Price :</label>
|
||||
<input type="text" class="form-control" name="price" value="{{ $game->price }}"/>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Update Data</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,45 @@
|
||||
<!-- index.blade.php -->
|
||||
|
||||
@extends('layout')
|
||||
|
||||
@section('content')
|
||||
<style>
|
||||
.uper {
|
||||
margin-top: 40px;
|
||||
}
|
||||
</style>
|
||||
<div class="uper">
|
||||
@if(session()->get('success'))
|
||||
<div class="alert alert-success">
|
||||
{{ session()->get('success') }}
|
||||
</div><br />
|
||||
@endif
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Game Name</td>
|
||||
<td>Game Price</td>
|
||||
<td colspan="2">Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($games as $game)
|
||||
<tr>
|
||||
<td>{{$game->id}}</td>
|
||||
<td>{{$game->name}}</td>
|
||||
<td>{{$game->price}}</td>
|
||||
<td><a href="{{ route('games.edit', $game->id)}}" class="btn btn-primary">Edit</a></td>
|
||||
<td>
|
||||
<form action="{{ route('games.destroy', $game->id)}}" method="post">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
@endsection
|
||||
@@ -0,0 +1,18 @@
|
||||
<!-- layout.blade.php -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Laravel 8 CRUD Tutorial</title>
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
@yield('content')
|
||||
</div>
|
||||
<script src="{{ asset('js/app.js') }}" type="text/js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user