preparations done
This commit is contained in:
@ -7,13 +7,14 @@ namespace App\Http\Controllers;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Models\Post;
|
use App\Models\Post;
|
||||||
use App\Models\Slider;
|
use App\Models\Slider;
|
||||||
|
use App\Models\Preparation;
|
||||||
|
|
||||||
class FrontendController extends Controller
|
class FrontendController extends Controller
|
||||||
{
|
{
|
||||||
public function homePage()
|
public function homePage()
|
||||||
{
|
{
|
||||||
$data['sliderItems'] = Slider::all();
|
$data['sliderItems'] = Slider::all();
|
||||||
// $data['preparations'] = Preparation::all();
|
$data['preparations'] = Preparation::all();
|
||||||
// $data['services'] = Service::all();
|
// $data['services'] = Service::all();
|
||||||
// $data['about'] = About::all();
|
// $data['about'] = About::all();
|
||||||
// $data['contact'] = Contact::first();
|
// $data['contact'] = Contact::first();
|
||||||
|
@ -7,26 +7,17 @@ use Illuminate\Http\Request;
|
|||||||
|
|
||||||
class PreparationController extends Controller
|
class PreparationController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Display a listing of the resource.
|
|
||||||
*/
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$preparations = PreparationController::all();
|
$preparations = Preparation::all();
|
||||||
return view('preparation.index', compact('preparations'));
|
return view('preparations.index', compact('preparations'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*/
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
return view('posts.create');
|
return view('preparations.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$validated = $request->validate([
|
$validated = $request->validate([
|
||||||
@ -35,28 +26,19 @@ class PreparationController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
Preparation::create($validated);
|
Preparation::create($validated);
|
||||||
return redirect()->route('preparation.index')->with('success', 'Preparation created successfully');
|
return redirect()->route('preparations.index')->with('success', 'Preparation created successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function show(Preparation $preparation)
|
||||||
* Display the specified resource.
|
|
||||||
*/
|
|
||||||
public function show(string $id)
|
|
||||||
{
|
{
|
||||||
return view('preparations.show', compact('preparation'));
|
return view('preparations.show', compact('preparation'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function edit(Preparation $preparation)
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*/
|
|
||||||
public function edit(string $id)
|
|
||||||
{
|
{
|
||||||
return view('preparations.edit', compact('preparation'));
|
return view('preparations.edit', compact('preparation'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(Request $request, Preparation $preparation)
|
public function update(Request $request, Preparation $preparation)
|
||||||
{
|
{
|
||||||
$validated = $request->validate([
|
$validated = $request->validate([
|
||||||
@ -65,16 +47,13 @@ class PreparationController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$preparation->update($validated);
|
$preparation->update($validated);
|
||||||
return redirect()->route('preparation.index')->with('success', 'Preparation updated successfully');
|
return redirect()->route('preparations.index')->with('success', 'Preparation updated successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy(Preparation $preparation)
|
public function destroy(Preparation $preparation)
|
||||||
{
|
{
|
||||||
$preparation->delete();
|
$preparation->delete();
|
||||||
|
|
||||||
return redirect()->route('preparation.index')->with('success', 'Preparation deleted successfully');
|
return redirect()->route('preparations.index')->with('success', 'Preparation deleted successfully');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('preparations', function (Blueprint $table) {
|
||||||
|
$table->text('content')->change(); // or longText
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
@ -8,6 +8,7 @@
|
|||||||
<a href="{{ route('employees.index') }}" class="btn btn-secondary">Manage Employees</a>
|
<a href="{{ route('employees.index') }}" class="btn btn-secondary">Manage Employees</a>
|
||||||
<a href="{{ route('posts.index') }}" class="btn btn-secondary">Manage Posts</a>
|
<a href="{{ route('posts.index') }}" class="btn btn-secondary">Manage Posts</a>
|
||||||
<a href="{{ route('sliders.index') }}" class="btn btn-secondary">Manage Sliders</a>
|
<a href="{{ route('sliders.index') }}" class="btn btn-secondary">Manage Sliders</a>
|
||||||
|
<a href="{{ route('preparations.index') }}" class="btn btn-secondary">Manage Preparations</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
@section('content')
|
@section('content')
|
||||||
@include('frontend.header')
|
@include('frontend.header')
|
||||||
@include('frontend.partials.slider', ['sliderItems' => $sliderItems])
|
@include('frontend.partials.slider', ['sliderItems' => $sliderItems])
|
||||||
{{-- @include('frontend.partials.preparation', ['preparations' => $preparations]) --}}
|
@include('frontend.partials.preparation', ['preparations' => $preparations])
|
||||||
{{-- @include('frontend.partials.service', ['services' => $services]) --}}
|
{{-- @include('frontend.partials.service', ['services' => $services]) --}}
|
||||||
{{-- @include('frontend.partials.about', ['about' => $about]) --}}
|
{{-- @include('frontend.partials.about', ['about' => $about]) --}}
|
||||||
{{-- @include('frontend.partials.contact', ['contact' => $contact]) --}}
|
{{-- @include('frontend.partials.contact', ['contact' => $contact]) --}}
|
||||||
|
108
resources/views/frontend/partials/preparation.blade.php
Normal file
108
resources/views/frontend/partials/preparation.blade.php
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
<!--site-main start-->
|
||||||
|
<div class="site-main">
|
||||||
|
{{-- @dd($preparations) --}}
|
||||||
|
<!--welcome-section-->
|
||||||
|
<section class="ttm-row welcome-section ttm-bgcolor-grey clearfix">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row plr15 res-1199-pl-0 res-1199-pr-0">
|
||||||
|
@foreach($preparations as $preparation)
|
||||||
|
<div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 abc">
|
||||||
|
<!-- featured-iconbox -->
|
||||||
|
<div class="featured-icon-box icon-align-before-content style19">
|
||||||
|
<!-- featured-icon -->
|
||||||
|
<div class="featured-icon">
|
||||||
|
<div class="ttm-icon ttm-icon_element-size-lg ttm-icon_element-onlytxt ttm-icon_element-color-skincolor">
|
||||||
|
<i class="flaticon flaticon-heart-5"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- featured-icon end-->
|
||||||
|
<!-- featured-content -->
|
||||||
|
<div class="featured-content">
|
||||||
|
<div class="featured-title">
|
||||||
|
<h3><a href="about.php" tabindex="0">{{$preparation->title}}</a></h3>
|
||||||
|
</div>
|
||||||
|
<div class="featured-desc">
|
||||||
|
<p> {{$preparation->content}}</p>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-content-end -->
|
||||||
|
<div class="featured-bottom">
|
||||||
|
<a class="" href="about.php" tabindex="0"><i class="ti ti-arrow-top-right"></i></a>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-iconbox-end -->
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
{{-- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 abc">
|
||||||
|
<!-- featured-iconbox -->
|
||||||
|
<div class="featured-icon-box icon-align-before-content style19">
|
||||||
|
<!-- featured-icon -->
|
||||||
|
<div class="featured-icon">
|
||||||
|
<div class="ttm-icon ttm-icon_element-size-lg ttm-icon_element-onlytxt ttm-icon_element-color-skincolor">
|
||||||
|
<i class="flaticon flaticon-doctor-1"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- featured-icon end-->
|
||||||
|
<!-- featured-content -->
|
||||||
|
<div class="featured-content">
|
||||||
|
<div class="featured-title">
|
||||||
|
<h3><a href="about.php" tabindex="0">CGFNS preparation</a></h3>
|
||||||
|
</div>
|
||||||
|
<div class="featured-desc">
|
||||||
|
<p>(Comission on Graduates of Foreign Nursing Schools) is to serve the global community through programs and services that verify and promote the knowledge- based practice competency of healthcare professionals.</p>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-content-end -->
|
||||||
|
<div class="featured-bottom">
|
||||||
|
<a class="" href="about.php" tabindex="0"><i class="ti ti-arrow-top-right"></i></a>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-iconbox-end -->
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 abc">
|
||||||
|
<!-- featured-iconbox -->
|
||||||
|
<div class="featured-icon-box icon-align-before-content style19">
|
||||||
|
<!-- featured-icon -->
|
||||||
|
<div class="featured-icon">
|
||||||
|
<div class="ttm-icon ttm-icon_element-size-lg ttm-icon_element-onlytxt ttm-icon_element-color-skincolor">
|
||||||
|
<i class="flaticon flaticon-defribillator"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- featured-icon end-->
|
||||||
|
<!-- featured-content -->
|
||||||
|
<div class="featured-content">
|
||||||
|
<div class="featured-title">
|
||||||
|
<h3><a href="about.php" tabindex="0">OET preparation</a></h3>
|
||||||
|
</div>
|
||||||
|
<div class="featured-desc">
|
||||||
|
<p>OET is an English language test for healthcare professionals recognized by various regulatory healthcare bodies. It assesses the language communication skills of healthcare professionals who wish to register and practice in an English- speaking environment.</p>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-content-end -->
|
||||||
|
<div class="featured-bottom">
|
||||||
|
<a class="" href="about.php" tabindex="0"><i class="ti ti-arrow-top-right"></i></a>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-iconbox-end -->
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 abc">
|
||||||
|
<!-- featured-iconbox -->
|
||||||
|
<div class="featured-icon-box icon-align-before-content style19">
|
||||||
|
<!-- featured-icon -->
|
||||||
|
<div class="featured-icon">
|
||||||
|
<div class="ttm-icon ttm-icon_element-size-lg ttm-icon_element-onlytxt ttm-icon_element-color-skincolor">
|
||||||
|
<i class="flaticon flaticon-cardiology-2"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- featured-icon end-->
|
||||||
|
<!-- featured-content -->
|
||||||
|
<div class="featured-content">
|
||||||
|
<div class="featured-title">
|
||||||
|
<h3><a href="about.php" tabindex="0">OBA preparation</a></h3>
|
||||||
|
</div>
|
||||||
|
<div class="featured-desc">
|
||||||
|
<p>OBA is also referred to as an aunthentic assessment in the sense that the assessment is realistic. It is basically the assessment process for Internationally Qualified Nurses and Midwives (IQNMS) with an international nursing qualification to be a registered nurse.</p>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-content-end -->
|
||||||
|
<div class="featured-bottom">
|
||||||
|
<a class="" href="about.php" tabindex="0"><i class="ti ti-arrow-top-right"></i></a>
|
||||||
|
</div>
|
||||||
|
</div><!-- featured-iconbox-end -->
|
||||||
|
</div> --}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section><!--welcome-section end-->
|
@ -44,6 +44,9 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ route('sliders.index') }}">Sliders</a>
|
<a class="nav-link" href="{{ route('sliders.index') }}">Sliders</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{{ route('preparations.index') }}">Preparations</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="navbar-nav ms-auto">
|
<ul class="navbar-nav ms-auto">
|
||||||
|
24
resources/views/preparations/create.blade.php
Normal file
24
resources/views/preparations/create.blade.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container">
|
||||||
|
<h1>Create New Preparation</h1>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('preparations.store') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Title</label>
|
||||||
|
<input type="text" name="title" class="form-control" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Content</label>
|
||||||
|
<textarea name="content" class="form-control" rows="3" required></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-success">Save</button>
|
||||||
|
<a href="{{ route('preparations.index') }}" class="btn btn-secondary">Cancel</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
24
resources/views/preparations/edit.blade.php
Normal file
24
resources/views/preparations/edit.blade.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container">
|
||||||
|
<h1>Edit Preparation</h1>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('preparations.update', $preparation->id) }}">
|
||||||
|
@csrf @method('PUT')
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Title</label>
|
||||||
|
<input type="text" name="title" class="form-control" value="{{ $preparation->title }}" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label">Content</label>
|
||||||
|
<textarea name="content" class="form-control" rows="5" required>{{ $preparation->content }}</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-success">Update</button>
|
||||||
|
<a href="{{ route('preparations.index') }}" class="btn btn-secondary">Cancel</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
41
resources/views/preparations/index.blade.php
Normal file
41
resources/views/preparations/index.blade.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container">
|
||||||
|
<h1>Preparations</h1>
|
||||||
|
|
||||||
|
<a href="{{ route('preparations.create') }}" class="btn btn-primary mb-3">Create New Preparation</a>
|
||||||
|
|
||||||
|
@if(session('success'))
|
||||||
|
<div class="alert alert-success">{{ session('success') }}</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>Content</th>
|
||||||
|
<th>Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@forelse($preparations as $preparation)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $preparation->title }}</td>
|
||||||
|
<td>{{ \Illuminate\Support\Str::limit($preparation->content, 50) }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ route('preparations.show', $preparation->id) }}" class="btn btn-sm btn-info">View</a>
|
||||||
|
<a href="{{ route('preparations.edit', $preparation->id) }}" class="btn btn-sm btn-warning">Edit</a>
|
||||||
|
<form action="{{ route('preparations.destroy', $preparation->id) }}" method="POST" style="display:inline-block">
|
||||||
|
@csrf @method('DELETE')
|
||||||
|
<button class="btn btn-sm btn-danger" onclick="return confirm('Delete this preparation?')">Delete</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr><td colspan="3">No preparations found.</td></tr>
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
@endsection
|
14
resources/views/preparations/show.blade.php
Normal file
14
resources/views/preparations/show.blade.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container">
|
||||||
|
<h1>{{ $preparation->title }}</h1>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
<p>{{ $preparation->content }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a href="{{ route('preparations.edit', $preparation->id) }}" class="btn btn-warning">Edit</a>
|
||||||
|
<a href="{{ route('preparations.index') }}" class="btn btn-secondary">Back</a>
|
||||||
|
</div>
|
||||||
|
@endsection
|
Reference in New Issue
Block a user