services done
This commit is contained in:
52
resources/views/abouts/create.blade.php
Normal file
52
resources/views/abouts/create.blade.php
Normal file
@ -0,0 +1,52 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h1>Create About Section</h1>
|
||||
<form action="{{ route('abouts.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="form-group mb-3">
|
||||
<label for="title">Title</label>
|
||||
<input type="text" name="title" value="{{ old('title') }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="description">Description</label>
|
||||
<textarea name="description" class="form-control" rows="4">{{ old('description') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="icon_class">Icon Class</label>
|
||||
<input type="text" name="icon_class" value="{{ old('icon_class') }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="button_text">Button Text</label>
|
||||
<input type="text" name="button_text" value="{{ old('button_text') }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="button_url">Button URL</label>
|
||||
<input type="text" name="button_url" value="{{ old('button_url') }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="image">Image</label>
|
||||
<input type="file" name="image" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for ="display_order">Display Order</label>
|
||||
<input type="number" name="display_order" value="{{ old('display_order') }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for ="extra_classes">Extra Classes</label>
|
||||
<input type="text" name="extra_classes" value="{{ old('extra_classes') }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success" type="submit">Save</button>
|
||||
<a href="{{ route('abouts.index') }}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
64
resources/views/abouts/edit.blade.php
Normal file
64
resources/views/abouts/edit.blade.php
Normal file
@ -0,0 +1,64 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h1>Edit About Section</h1>
|
||||
|
||||
<form action="{{ route('abouts.update', $about->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Title</label>
|
||||
<input type="text" name="title" value="{{ old('title', $about->title) }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Description</label>
|
||||
<textarea name="description" class="form-control" rows="4">{{ old('description', $about->description) }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Icon Class</label>
|
||||
<input type="text" name="icon_class" value="{{ old('icon_class', $about->icon_class) }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Button Text</label>
|
||||
<input type="text" name="button_text" value="{{ old('button_text', $about->button_text) }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Button URL</label>
|
||||
<input type="text" name="button_url" value="{{ old('button_url', $about->button_url) }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Current Image</label><br/>
|
||||
@if($about->image)
|
||||
<img src="{{ asset('storage/' . $about->image) }}" alt="Image" width="120" />
|
||||
@else
|
||||
No image uploaded
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Change Image</label>
|
||||
<input type="file" name="image" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Display Order</label>
|
||||
<input type="number" name="display_order" value="{{ old('display_order', $about->display_order) }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label>Extra Classes</label>
|
||||
<input type="text" name="extra_classes" value="{{ old('extra_classes', $about->extra_classes) }}" class="form-control" />
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary" type="submit">Update</button>
|
||||
<a href="{{ route('abouts.index') }}" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
55
resources/views/abouts/index.blade.php
Normal file
55
resources/views/abouts/index.blade.php
Normal file
@ -0,0 +1,55 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h1>About Sections</h1>
|
||||
<a href="{{ route('abouts.create') }}" class="btn btn-primary mb-3">Create New About</a>
|
||||
|
||||
@if(session('success'))
|
||||
<div class="alert alert-success">{{ session('success') }}</div>
|
||||
@endif
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th>Icon Class</th>
|
||||
<th>Button Text</th>
|
||||
<th>Button URL</th>
|
||||
<th>Image</th>
|
||||
<th>Display Order</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($abouts as $about)
|
||||
<tr>
|
||||
<td>{{ $about->title }}</td>
|
||||
<td>{{ Str::limit($about->description, 50) }}</td>
|
||||
<td>{{ $about->icon_class }}</td>
|
||||
<td>{{ $about->button_text }}</td>
|
||||
<td>{{ $about->button_url }}</td>
|
||||
<td>
|
||||
@if($about->image)
|
||||
<img src="{{ asset('storage/' . $about->image) }}" alt="Image" width="80" />
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $about->display_order }}</td>
|
||||
<td>
|
||||
<a href="{{ route('abouts.show', $about->id) }}" class="btn btn-sm btn-info">View</a>
|
||||
<a href="{{ route('abouts.edit', $about->id) }}" class="btn btn-sm btn-warning">Edit</a>
|
||||
<form action="{{ route('abouts.destroy', $about->id) }}" method="POST" style="display:inline-block;" onsubmit="return confirm('Delete this about?')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
26
resources/views/abouts/show.blade.php
Normal file
26
resources/views/abouts/show.blade.php
Normal file
@ -0,0 +1,26 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h1>About Details</h1>
|
||||
|
||||
<div class="mb-3"><strong>Title:</strong> {{ $about->title }}</div>
|
||||
<div class="mb-3"><strong>Description:</strong> {!! nl2br(e($about->description)) !!}</div>
|
||||
<div class="mb-3"><strong>Icon Class:</strong> {{ $about->icon_class }}</div>
|
||||
<div class="mb-3"><strong>Button Text:</strong> {{ $about->button_text }}</div>
|
||||
<div class="mb-3"><strong>Button URL:</strong> <a href="{{ $about->button_url }}" target="_blank">{{ $about->button_url }}</a></div>
|
||||
<div class="mb-3">
|
||||
<strong>Image:</strong><br />
|
||||
@if($about->image)
|
||||
<img src="{{ asset('storage/' . $about->image) }}" alt="Image" style="max-width:300px;" />
|
||||
@else
|
||||
No image uploaded
|
||||
@endif
|
||||
</div>
|
||||
<div class="mb-3"><strong>Display Order:</strong> {{ $about->display_order }}</div>
|
||||
<div class="mb-3"><strong>Extra Classes:</strong> {{ $about->extra_classes }}</div>
|
||||
|
||||
<a href="{{ route('abouts.index') }}" class="btn btn-secondary">Back to List</a>
|
||||
<a href="{{ route('abouts.edit', $about->id) }}" class="btn btn-warning">Edit</a>
|
||||
</div>
|
||||
@endsection
|
Reference in New Issue
Block a user