Compare commits

..

75 Commits

Author SHA1 Message Date
e0f1fb9892 Added ChatBot Module in CCMS 2025-09-03 16:39:24 +05:45
c61caabe93 checkbox fixes enquiry for bulk mail 2025-09-03 16:11:11 +05:45
22a7876a10 changes in dashboard in ccms 2025-09-03 12:31:35 +05:45
1d517d6bbd dashboard changes 2025-09-02 18:02:32 +05:45
2e0fa5a29c fixes 2025-09-02 17:35:17 +05:45
507d71888e icon changes 2025-09-02 17:24:50 +05:45
b092a69b30 changes in logo size and sidebar dashboard 2025-09-02 16:37:09 +05:45
5b5e19f919 toastr error fixed and document workable with other minor error fixes 2025-09-02 16:22:25 +05:45
f8f496077b Added CSS for the dashboard design similar to LMS and Heera 2025-09-02 12:48:52 +05:45
3666b749ea changes in email template for enquiries and form submittion, other all minor error fixed. 2025-08-28 13:11:34 +05:45
086395a0a4 feat: Implement vacancy management features including listing, creating, and editing vacancies 2025-08-27 17:53:32 +05:45
2ca99f9dbc fixes 2025-08-27 12:06:10 +05:45
3f503c2d38 fix 2025-08-27 12:05:11 +05:45
032e8405ca fix: Update gallery form to change label from 'Video Link' to 'Description' and adjust placeholder text 2025-08-27 12:01:42 +05:45
f22a60fef4 fixes 2025-08-26 17:46:25 +05:45
5299aa268f Remove unused class column from enquiries data table and enhance form validation 2025-08-26 17:36:15 +05:45
40d34a7692 fix: Adjust cost calculation based on service status in cost result view 2025-08-25 17:22:42 +05:45
658d3600a2 maintained filteration in stay type in cost calculator 2025-08-25 16:20:07 +05:45
dc32ac8f91 fix 2025-08-24 18:03:00 +05:45
9d371a8d0f fix 2025-08-24 17:58:58 +05:45
0c9adf1c7a fix 2025-08-24 17:49:47 +05:45
087c19dc4a fix: Correct column title from 'Contact' to 'Mobile' in enquiry index 2025-08-24 17:46:26 +05:45
0c92a6f518 fix 2025-08-24 17:42:15 +05:45
2d8c43691f feat: Enhance contact form with required fields for name, email, mobile, and message 2025-08-24 17:40:28 +05:45
27f371955c feat: Update contact form with proper action and input names for enquiry submission 2025-08-24 17:39:13 +05:45
1ee87559da fix: replace hardcoded map iframe with dynamic setting 2025-08-24 13:20:28 +05:45
6ef55240a0 Enhance 404 error page with custom layout and image, add admin login routes 2025-08-24 12:47:48 +05:45
6d71fe4b4a feat: Add Vacancy management functionality with controller, model, migration, and form 2025-08-22 17:03:00 +05:45
52732b0f09 feat: Implement Career Management Module
- Created CareerController for handling career-related CRUD operations.
- Added Career model with necessary attributes and relationships.
- Created migration for careers table with relevant fields.
- Developed views for creating, editing, and listing careers.
- Implemented DataTables for career listing with action buttons.
- Added routes for career management and integrated with sidebar.
- Created client-side career detail template and updated career listing page.
- Added helper functions to fetch active careers for display.
2025-08-22 13:52:06 +05:45
a11de7be9e Merge branch 'alika' of http://bibgit.com/Subash/new_raffles 2025-08-22 12:22:54 +05:45
faa2e77a46 uni size 2025-08-22 12:25:20 +05:45
f55aeec8e8 flex footer 2025-08-22 11:53:59 +05:45
b24e6a9c66 Merge branch 'alika' of http://bibgit.com/Subash/new_raffles 2025-08-22 11:51:25 +05:45
5f8c1aed38 Merge branch 'main' of ssh://bibgit.com:22022/Bibhuti-Solutions/new_raffles into alika 2025-08-22 11:51:18 +05:45
10b549315f social platform link 2025-08-22 11:51:06 +05:45
4c272e0e67 fix: Correct data attributes for first and last name fields in franchise index 2025-08-22 11:48:23 +05:45
724f46a82c fixes 2025-08-22 11:45:38 +05:45
1a744e1e2f fix 2025-08-22 11:36:34 +05:45
0652a07452 feat: Add galleries data to page views and update templates for dynamic content 2025-08-22 11:35:47 +05:45
d966b75f56 fix: Update image asset paths and modify event loop to display previous events 2025-08-22 11:26:50 +05:45
bce7ec8d3a error fix 2025-08-22 11:17:01 +05:45
31bea937c4 feat: Add functions to retrieve previous and upcoming events; update events template to display dynamic event data 2025-08-22 11:15:13 +05:45
711ae9caf9 feat: Implement Event management features including CRUD operations and routing 2025-08-22 11:03:10 +05:45
ce09f98c55 feat: Add franchise and newsletter routes; update CSR template layout 2025-08-22 10:14:26 +05:45
d29b3ba489 Add Franchise and Newsletter management features
- Implemented FranchiseController with CRUD operations and data handling.
- Created NewsletterController for managing newsletter subscriptions.
- Added routes for Franchise and Newsletter resources in web.php.
- Developed views for Franchise and Newsletter management including index, create, edit, and datatable actions.
- Introduced form handling and validation for Franchise and Newsletter submissions.
- Created database migrations for franchises and newsletters tables.
- Updated sidebar configuration to include Franchise and Newsletter sections.
- Enhanced client-side forms with AJAX submission for Franchise and Newsletter.
2025-08-21 23:23:38 +05:45
7f9d6bc8ec Merge branch 'alika' of http://bibgit.com/Subash/new_raffles 2025-08-21 22:15:42 +05:45
7155c1a6fc fix: Update image sources to use dynamic asset paths and implement blog loop in CSR template 2025-08-21 18:08:59 +05:45
6e9b6291d3 changes 2025-08-21 18:04:02 +05:45
622b9e9445 fix: Update service icon background color to blue in header 2025-08-21 18:01:48 +05:45
3148715b73 terms and condition changes 2025-08-21 17:55:44 +05:45
6ff22bc02d gallary changes 2025-08-21 17:50:39 +05:45
badfdc4c70 change in event 2025-08-21 17:41:22 +05:45
3bfb3f2b20 event changes 2025-08-21 17:37:05 +05:45
2a2222d0c6 social platform route 2025-08-21 17:29:08 +05:45
a57e00191a fix: Update franchise template to use dynamic content for images and contact details 2025-08-21 17:25:31 +05:45
c77828de8c fix: Update slidesPerView setting for improved carousel responsiveness 2025-08-21 17:06:44 +05:45
50a2b09cfa fix: Increase slidesPerView setting for enhanced carousel display on larger screens 2025-08-21 17:04:48 +05:45
a504987ac1 fix: Update slidesPerView setting for improved carousel display on larger screens 2025-08-21 17:03:49 +05:45
e80c67c0e2 fix: Adjust slidesPerView setting for better responsiveness in carousel 2025-08-21 17:02:39 +05:45
a145943bd1 Merge branch 'main' of ssh://bibgit.com:22022/Bibhuti-Solutions/new_raffles into alika 2025-08-21 17:00:41 +05:45
3ca3681513 text edited 2025-08-21 17:00:31 +05:45
fb52c42208 fix: Correct data-target attribute and format image tag in universities section 2025-08-21 16:35:18 +05:45
d5de6658f0 image object fit 2025-08-21 15:58:32 +05:45
f2bd2dd1c1 refactor: Update study destination template to improve FAQ section and comment out blog section 2025-08-21 15:53:49 +05:45
d357125961 Merge branch 'alika' of http://bibgit.com/Subash/new_raffles 2025-08-21 15:50:19 +05:45
8c6719e6c3 Add new pages for gallery, sitemap, social platforms, terms, and update study destination template
- Created gallery-template.blade.php for displaying a gallery of images.
- Added sitemap.blade.php to outline the structure of the website.
- Introduced social-platform-template.blade.php for showcasing social media links.
- Implemented terms-template.blade.php to present terms and conditions.
- Updated study-destination-template.blade.php to remove redundant code and improve structure.
- Commented out dashboard toggle switch in navbar for future reference.
2025-08-21 15:40:47 +05:45
df97f3c842 footer column 2025-08-21 15:34:15 +05:45
efd675d576 footer column 2025-08-21 15:33:46 +05:45
7c25b17de9 fix: Remove duplicate '@extends' directive in study destination template 2025-08-21 12:45:36 +05:45
54a662b973 fix: Correct image path for partner background in universities slider 2025-08-21 12:40:56 +05:45
f6339f909e fix: Update FAQ rendering to allow HTML content and correct numbering in tab buttons 2025-08-21 12:35:06 +05:45
3bda70472d Merge branch 'alika' of http://bibgit.com/Subash/new_raffles 2025-08-21 12:29:02 +05:45
d15949d9c2 feat: Add FAQs field to Country model and update form for extra FAQs input 2025-08-21 12:28:07 +05:45
73c20015a8 swiper 2025-08-21 12:25:54 +05:45
8953fa8d19 contact form 2025-08-21 12:19:44 +05:45
132 changed files with 9970 additions and 2913 deletions

View File

@@ -0,0 +1,137 @@
<?php
namespace Modules\CCMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Modules\CCMS\Models\Career;
use Yajra\DataTables\Facades\DataTables;
class CareerController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
if (request()->ajax()) {
$model = Career::query()->orderBy('order');
return DataTables::eloquent($model)
->addIndexColumn()
->setRowClass('tableRow')
->editColumn('status', function (Career $career) {
$status = $career->status ? 'Published' : 'Draft';
$color = $career->status ? 'text-success' : 'text-danger';
return "<p class='{$color}'>{$status}</p>";
})
->addColumn('action', 'ccms::career.datatable.action')
->rawColumns(['status', 'action'])
->toJson();
}
return view('ccms::career.index', [
'title' => 'Career List',
]);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$careerOptions = Career::where('status', 1)->pluck('job_title', 'id');
return view('ccms::career.create', [
'title' => 'Create Career',
'editable' => false,
'careerOptions' => $careerOptions
]);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$maxOrder = Career::max('order');
$order = $maxOrder ? ++$maxOrder : 1;
$request->mergeIfMissing([
'slug' => Str::slug($request->title),
// 'order' => $order,
]);
Career::create($request->all());
flash()->success("Career has been created!");
return redirect()->route('career.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('ccms::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$careerOptions = Career::where('status', 1)->pluck('job_title', 'id');
$career = Career::findOrFail($id);
return view('ccms::career.edit', [
'title' => 'Edit Career',
'editable' => true,
'career' => $career,
'careerOptions' => $careerOptions
]);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
$request->merge([
'slug' => Str::slug($request->title),
]);
$validated = $request->validate([]);
$career = Career::findOrFail($id);
$career->update($request->all());
flash()->success("Career has been updated.");
return redirect()->back();
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
$career = Career::findOrFail($id);
$career->delete();
return response()->json(['status' => 200, 'message' => "Career has been deleted."], 200);
}
public function reorder(Request $request)
{
$careers = Career::all();
foreach ($careers as $career) {
foreach ($request->order as $order) {
if ($order['id'] == $career->id) {
$career->update(['order' => $order['position']]);
}
}
}
return response(['status' => true, 'message' => 'Reordered successfully'], 200);
}
public function toggle($id)
{
$career = Career::findOrFail($id);
$career->update(['status' => !$career->status]);
return response(['status' => 200, 'message' => 'Toggled successfully'], 200);
}
}

View File

@@ -20,8 +20,11 @@ class CounselorController extends Controller
$model = Counselor::query()->latest(); $model = Counselor::query()->latest();
return DataTables::eloquent($model) return DataTables::eloquent($model)
->addIndexColumn() ->addIndexColumn()
->addColumn('checkbox', function (Counselor $enquiry) {
return '<input type="checkbox" class="enquiry-select" value="' . $enquiry->id . '" data-name="' . $enquiry->name . '">';
})
->addColumn('action', 'ccms::counselor.datatable.action') ->addColumn('action', 'ccms::counselor.datatable.action')
->rawColumns(['action']) ->rawColumns(['checkbox', 'action'])
->toJson(); ->toJson();
} }
return view('ccms::counselor.index', [ return view('ccms::counselor.index', [

View File

@@ -18,10 +18,14 @@ class EnquiryController extends Controller
public function index() public function index()
{ {
// $is_enrolled = request()->get('is_enrolled', null);
if (request()->ajax()) { if (request()->ajax()) {
$model = Enquiry::query()->latest(); $model = Enquiry::query()->latest();
return DataTables::eloquent($model) return DataTables::eloquent($model)
->addIndexColumn() ->addIndexColumn()
->addColumn('checkbox', function (Enquiry $enquiry) {
return '<input type="checkbox" class="enquiry-select" value="' . $enquiry->id . '">';
})
->setRowClass(function (Enquiry $enquiry) { ->setRowClass(function (Enquiry $enquiry) {
return $enquiry->is_read ? 'text-muted' : 'text-dark'; return $enquiry->is_read ? 'text-muted' : 'text-dark';
}) })
@@ -35,7 +39,7 @@ class EnquiryController extends Controller
return $enquiry->message ?? '-'; return $enquiry->message ?? '-';
}) })
->addColumn('action', 'ccms::enquiry.datatable.action') ->addColumn('action', 'ccms::enquiry.datatable.action')
->rawColumns(['action']) ->rawColumns(['checkbox', 'action'])
->toJson(); ->toJson();
} }
return view('ccms::enquiry.index', [ return view('ccms::enquiry.index', [
@@ -60,6 +64,7 @@ class EnquiryController extends Controller
$rules = [ $rules = [
'name' => 'required|string', 'name' => 'required|string',
'email' => 'required|email', 'email' => 'required|email',
'mobile' => 'required|string',
'digits:10', 'digits:10',
'subject' => 'nullable', 'subject' => 'nullable',
'message' => 'nullable|max:250', 'message' => 'nullable|max:250',
@@ -140,4 +145,34 @@ class EnquiryController extends Controller
return redirect()->back()->with('error', $th->getMessage()); return redirect()->back()->with('error', $th->getMessage());
} }
} }
public function bulkAction(Request $request)
{
$ids = $request->ids;
$action = $request->action;
if (!$ids || !$action) {
return response()->json(['message' => 'No action performed.'], 400);
}
$enquiries = Enquiry::whereIn('id', $ids)->get();
if ($action == 2) {
// Example: send newsletter
foreach ($enquiries as $enquiry) {
// Your newsletter logic here
}
return response()->json(['message' => 'Newsletter sent to selected enquiries!']);
}
if ($action == 3) {
// Example: send normal mail
foreach ($enquiries as $enquiry) {
// Your mail logic here
}
return response()->json(['message' => 'Mails sent to selected enquiries!']);
}
return response()->json(['message' => 'Invalid action.'], 400);
}
} }

View File

@@ -0,0 +1,147 @@
<?php
namespace Modules\CCMS\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Modules\CCMS\Models\Event;
use Yajra\DataTables\Facades\DataTables;
class EventController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
if (request()->ajax()) {
$model = Event::query()->orderBy('order');
return DataTables::eloquent($model)
->addIndexColumn()
->setRowClass('tableRow')
->editColumn('image', function (Event $event) {
return $event->getRawOriginal('image') ? "<img src='{$event->image}' alt='{$event->title}' class='rounded avatar-sm material-shadow ms-2 img-thumbnail'>" : '-';
})
->editColumn('parent_id', function (Event $event) {
return $event->parent ? "<span class='badge bg-primary p-1'>{$event->parent?->title}</span>" : '-';
})
->editColumn('status', function (Event $event) {
$status = $event->status ? 'Published' : 'Draft';
$color = $event->status ? 'text-success' : 'text-danger';
return "<p class='{$color}'>{$status}</p>";
})
->addColumn('action', 'ccms::event.datatable.action')
->rawColumns(['parent_id', 'image', 'status', 'action'])
->toJson();
}
return view('ccms::event.index', [
'title' => 'Event List',
]);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$eventOptions = Event::where('status', 1)->pluck('title', 'id');
return view('ccms::event.create', [
'title' => 'Create Event',
'editable' => false,
'eventOptions' => $eventOptions
]);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
$maxOrder = Event::max('order');
$order = $maxOrder ? ++$maxOrder : 1;
$request->mergeIfMissing([
'slug' => Str::slug($request->title),
'order' => $order,
]);
$validated = $request->validate([
'title' => 'required',
]);
Event::create($request->all());
flash()->success("Event has been created!");
return redirect()->route('event.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('ccms::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$eventOptions = Event::where('status', 1)->pluck('title', 'id');
$event = Event::findOrFail($id);
return view('ccms::event.edit', [
'title' => 'Edit Event',
'editable' => true,
'event' => $event,
'eventOptions' => $eventOptions
]);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
$request->merge([
'slug' => Str::slug($request->title),
]);
$validated = $request->validate([]);
$event = Event::findOrFail($id);
$event->update($request->all());
flash()->success("Event has been updated.");
return redirect()->back();
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
$event = Event::findOrFail($id);
$event->delete();
return response()->json(['status' => 200, 'message' => "Event has been deleted."], 200);
}
public function reorder(Request $request)
{
$events = Event::all();
foreach ($events as $event) {
foreach ($request->order as $order) {
if ($order['id'] == $event->id) {
$event->update(['order' => $order['position']]);
}
}
}
return response(['status' => true, 'message' => 'Reordered successfully'], 200);
}
public function toggle($id)
{
$event = Event::findOrFail($id);
$event->update(['status' => !$event->status]);
return response(['status' => 200, 'message' => 'Toggled successfully'], 200);
}
}

View File

@@ -0,0 +1,118 @@
<?php
namespace Modules\CCMS\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Rules\Recaptcha;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Validator;
use Modules\CCMS\Models\Franchise;
use Yajra\DataTables\Facades\DataTables;
class FranchiseController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
if (request()->ajax()) {
$model = Franchise::query()->latest();
return DataTables::eloquent($model)
->addIndexColumn()
->addColumn('checkbox', function (Franchise $enquiry) {
return '<input type="checkbox" class="enquiry-select" value="' . $enquiry->id . '" data-name="' . $enquiry->name . '">';
})
->addColumn('action', 'ccms::franchise.datatable.action')
->rawColumns(['checkbox', 'action'])
->toJson();
}
return view('ccms::franchise.index', [
'title' => 'Franchise List',
]);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
$rules = [
'first_name' => 'required|string',
'email' => 'required|email',
];
if (setting('enable_reCaptcha') == 1) {
$rules['g-recaptcha-response'] = ['required', new Recaptcha];
}
$messages = [
'email.email' => 'Must be a valid email address.',
'g-recaptcha-response.required' => 'Please complete reCAPTCHA validation.',
'g-recaptcha-response' => 'Invalid reCAPTCHA.',
];
$validator = Validator::make($request->all(), $rules, $messages);
if ($validator->fails()) {
return response()->json(['errors' => $validator->errors()], 422);
}
Franchise::create($request->all());
return response()->json(['status' => 200, 'message' => "Thank you for reaching out! Your message has been received and we'll get back to you shortly."], 200);
} catch (\Exception $e) {
return response()->json(['status' => 500, 'message' => 'Internal server error', 'error' => $e->getMessage()], 500);
}
}
/**
* Show the specified resource.
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$franchise = Franchise::whereId($id)->first();
if ($franchise) {
$franchise->delete();
}
return response()->json(['status' => 200, 'message' => 'Franchise has been deleted!'], 200);
} catch (\Throwable $th) {
return redirect()->back()->with('error', $th->getMessage());
}
}
}

View File

@@ -0,0 +1,117 @@
<?php
namespace Modules\CCMS\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Rules\Recaptcha;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Validator;
use Modules\CCMS\Models\Newsletter;
use Yajra\DataTables\Facades\DataTables;
class NewsletterController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
if (request()->ajax()) {
$model = Newsletter::query()->latest();
return DataTables::eloquent($model)
->addIndexColumn()
->addColumn('checkbox', function (Newsletter $enquiry) {
return '<input type="checkbox" class="enquiry-select" value="' . $enquiry->id . '" data-name="' . $enquiry->name . '">';
})
->addColumn('action', 'ccms::newsletter.datatable.action')
->rawColumns(['checkbox', 'action'])
->toJson();
}
return view('ccms::newsletter.index', [
'title' => 'Newsletter List',
]);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
$rules = [
'email' => 'required|email|unique:newsletters,email',
];
if (setting('enable_reCaptcha') == 1) {
$rules['g-recaptcha-response'] = ['required', new Recaptcha];
}
$messages = [
'email.email' => 'Must be a valid and unique email address.',
'g-recaptcha-response.required' => 'Please complete reCAPTCHA validation.',
'g-recaptcha-response' => 'Invalid reCAPTCHA.',
];
$validator = Validator::make($request->all(), $rules, $messages);
if ($validator->fails()) {
return response()->json(['errors' => $validator->errors()], 422);
}
Newsletter::create($validator->validated());
return response()->json(['status' => 200, 'message' => "Thank you for reaching out! Your message has been received and we'll get back to you shortly."], 200);
} catch (\Exception $e) {
return response()->json(['status' => 500, 'message' => 'Internal server error', 'error' => $e->getMessage()], 500);
}
}
/**
* Show the specified resource.
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$newsletter = Newsletter::whereId($id)->first();
if ($newsletter) {
$newsletter->delete();
}
return response()->json(['status' => 200, 'message' => 'Newsletter has been deleted!'], 200);
} catch (\Throwable $th) {
return redirect()->back()->with('error', $th->getMessage());
}
}
}

View File

@@ -16,59 +16,59 @@ class PageController extends Controller
* Display a listing of the resource. * Display a listing of the resource.
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$parentPages = Page::where(['status' => 1, 'type' => 'page'])->with("children")->get(); $parentPages = Page::where(['status' => 1, 'type' => 'page'])->with("children")->get();
if ($request->ajax()) { if ($request->ajax()) {
if ($request->filled("page_id")) { if ($request->filled("page_id")) {
$parentPage = Page::with('children')->find($request->get('page_id')); $parentPage = Page::with('children')->find($request->get('page_id'));
$pages = collect([]); $pages = collect([]);
if ($parentPage) { if ($parentPage) {
$pages = collect([$parentPage])->merge($parentPage->children); $pages = collect([$parentPage])->merge($parentPage->children);
}
} else {
$pages = Page::orderBy('order')->get();
} }
} else {
$pages = Page::orderBy('order')->get(); return DataTables::collection($pages)
->addIndexColumn()
->setRowClass('tableRow')
->editColumn('type', function ($page) {
return config("constants.page_type_options")[$page->type] ?? '-';
})
->editColumn('date', function ($page) {
return getFormatted(date: $page->date) ?? '-';
})
->editColumn('image', function (Page $page) {
return $page->getRawOriginal('image')
? "<img src='{$page->image}' alt='{$page->title}' class='rounded avatar-sm material-shadow ms-2 img-thumbnail'>"
: '-';
})
->addColumn('parents', function (Page $page) {
if ($page->parents->isEmpty()) {
return '-';
}
return $page->parents->map(function ($parent) {
return "<span class='badge bg-primary p-1'>{$parent->title}</span>";
})->implode(' ');
})
->editColumn('status', function (Page $page) {
$status = $page->status ? 'Published' : 'Draft';
$color = $page->status ? 'text-success' : 'text-danger';
return "<p class='{$color}'>{$status}</p>";
})
->addColumn('action', 'ccms::page.datatable.action')
->rawColumns(['parents', 'image', 'status', 'action'])
->toJson();
} }
return DataTables::collection($pages) return view('ccms::page.index', [
->addIndexColumn() 'title' => 'Page List',
->setRowClass('tableRow') 'parentPages' => $parentPages,
->editColumn('type', function ($page) { ]);
return config("constants.page_type_options")[$page->type] ?? '-';
})
->editColumn('date', function ($page) {
return getFormatted(date: $page->date) ?? '-';
})
->editColumn('image', function (Page $page) {
return $page->getRawOriginal('image')
? "<img src='{$page->image}' alt='{$page->title}' class='rounded avatar-sm material-shadow ms-2 img-thumbnail'>"
: '-';
})
->addColumn('parents', function (Page $page) {
if ($page->parents->isEmpty()) {
return '-';
}
return $page->parents->map(function ($parent) {
return "<span class='badge bg-primary p-1'>{$parent->title}</span>";
})->implode(' ');
})
->editColumn('status', function (Page $page) {
$status = $page->status ? 'Published' : 'Draft';
$color = $page->status ? 'text-success' : 'text-danger';
return "<p class='{$color}'>{$status}</p>";
})
->addColumn('action', 'ccms::page.datatable.action')
->rawColumns(['parents', 'image', 'status', 'action'])
->toJson();
} }
return view('ccms::page.index', [
'title' => 'Page List',
'parentPages' => $parentPages,
]);
}
/** /**
* Show the form for creating a new resource. * Show the form for creating a new resource.
@@ -92,7 +92,7 @@ class PageController extends Controller
$order = $maxOrder ? ++$maxOrder : 1; $order = $maxOrder ? ++$maxOrder : 1;
$request->merge([ $request->merge([
'order' => $order, 'order' => $order,
'status' => 0, 'status' => 1,
'slug' => $request->title == 'Homepage' ? '/' : Str::slug($request->title), 'slug' => $request->title == 'Homepage' ? '/' : Str::slug($request->title),
]); ]);
} }

View File

@@ -0,0 +1,138 @@
<?php
namespace Modules\CCMS\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Rules\Recaptcha;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Validator;
use Modules\CCMS\Models\Vacancy;
use Yajra\DataTables\Facades\DataTables;
class VacancyController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
if (request()->ajax()) {
$model = Vacancy::query()->latest();
return DataTables::eloquent($model)
->addIndexColumn()
->addColumn('checkbox', function (Vacancy $enquiry) {
return '<input type="checkbox" class="enquiry-select" value="' . $enquiry->id . '" data-name="' . $enquiry->name . '">';
})
->addColumn('action', 'ccms::vacancy.datatable.action')
->rawColumns(['checkbox', 'action'])
->toJson();
}
return view('ccms::vacancy.index', [
'title' => 'Vacancy List',
]);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
try {
// $rules = [
// ];
// if (setting('enable_reCaptcha') == 1) {
// $rules['g-recaptcha-response'] = ['required', new Recaptcha];
// }
// $messages = [
// 'email.email' => 'Must be a valid email address.',
// 'g-recaptcha-response.required' => 'Please complete reCAPTCHA validation.',
// 'g-recaptcha-response' => 'Invalid reCAPTCHA.',
// ];
// $validator = Validator::make($request->all());
// if ($validator->fails()) {
// return response()->json(['errors' => $validator->errors()], 422);
// }
$modelClass = "Modules\\CCMS\\Models\\Career";
$model = $modelClass::findOrFail($request->career_id);
foreach ($request->document as $file) {
$model->addToDocumentCollection(collectionName: 'uploads/document', file: $file, documentName: $request->first_name, referenceDocumentId: null);
}
Vacancy::create($request->all());
return response()->json(['status' => 200, 'message' => "Thank you for reaching out! Your message has been received and we'll get back to you shortly."], 200);
} catch (\Exception $e) {
return response()->json(['status' => 500, 'message' => 'Internal server error', 'error' => $e->getMessage()], 500);
}
}
/**
* Show the specified resource.
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
try {
$vacancy = Vacancy::whereId($id)->first();
if ($vacancy) {
$vacancy->delete();
}
return response()->json(['status' => 200, 'message' => 'Vacancy has been deleted!'], 200);
} catch (\Throwable $th) {
return redirect()->back()->with('error', $th->getMessage());
}
}
public function markAsRead($id)
{
try {
$vacancy = Vacancy::whereId($id)->first();
if ($vacancy) {
$vacancy->update(['is_read' => 1]);
}
return response()->json(['status' => 200, 'message' => 'Vacancy has been marked as read!'], 200);
} catch (\Throwable $th) {
return redirect()->back()->with('error', $th->getMessage());
}
}
}

View File

@@ -0,0 +1,97 @@
<?php
namespace Modules\CCMS\Models;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Modules\CCMS\Traits\UpdateCustomFields;
use Modules\Document\Models\Document;
use App\Traits\AddToDocumentCollection;
class Career extends Model
{
use HasFactory, UpdateCustomFields, AddToDocumentCollection, CreatedUpdatedBy;
protected $fillable = [
'department',
'job_title',
'job_description',
'job_requirements',
'salary_range',
'location',
'position',
'start_date',
'end_date',
'status',
'createdby',
'updatedby',
'order',
];
protected function casts(): array
{
return [
'custom' => 'array',
];
}
protected function images(): Attribute
{
return Attribute::make(
get: function ($value) {
if (empty($value)) {
return [];
}
$parts = explode(',', $value);
return array_map(fn($part) => asset(trim($part)), $parts);
}
);
}
protected function image(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
protected function banner(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
protected function sidebarImage(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
protected function iconImage(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
public function children()
{
return $this->hasMany(Career::class, 'parent_id');
}
public function parent()
{
return $this->belongsTo(Career::class, 'parent_id');
}
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
}

View File

@@ -23,6 +23,7 @@ class Country extends Model
'slug', 'slug',
'short_description', 'short_description',
'description', 'description',
'faqs',
'image', 'image',
'parent_id', 'parent_id',
'images', 'images',
@@ -104,5 +105,4 @@ class Country extends Model
{ {
return $this->morphMany(Document::class, 'documentable'); return $this->morphMany(Document::class, 'documentable');
} }
} }

View File

@@ -0,0 +1,113 @@
<?php
namespace Modules\CCMS\Models;
use App\Traits\CreatedUpdatedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Modules\CCMS\Traits\UpdateCustomFields;
use Modules\Document\Models\Document;
use App\Traits\AddToDocumentCollection;
class Event extends Model
{
use HasFactory, UpdateCustomFields, AddToDocumentCollection, CreatedUpdatedBy;
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'slug',
'short_description',
'description',
'parent_id',
'icon_class',
'icon_image',
'image',
'images',
'start_date',
'end_date',
'custom',
'banner',
'meta_title',
'meta_description',
'meta_keywords',
'sidebar_title',
'sidebar_content',
'sidebar_image',
'button_text',
'button_url',
'button_target',
'status',
'createdby',
'updatedby',
'order',
];
protected function casts(): array
{
return [
'custom' => 'array',
];
}
protected function images(): Attribute
{
return Attribute::make(
get: function ($value) {
if (empty($value)) {
return [];
}
$parts = explode(',', $value);
return array_map(fn($part) => asset(trim($part)), $parts);
}
);
}
protected function image(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
protected function banner(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
protected function sidebarImage(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
protected function iconImage(): Attribute
{
return Attribute::make(
get: fn($value) => asset($value),
);
}
public function children()
{
return $this->hasMany(Event::class, 'parent_id');
}
public function parent()
{
return $this->belongsTo(Event::class, 'parent_id');
}
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace Modules\CCMS\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
// use Modules\CCMS\Database\Factories\FranchiseFactory;
class Franchise extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'first_name',
'last_name',
'email',
'phone',
'address',
'city',
'state',
'invest_level',
'own_business',
'yes_own_des',
'franchise_location',
'start_time_frame',
'office_setup',
'website'
];
// protected static function newFactory(): FranchiseFactory
// {
// // return FranchiseFactory::new();
// }
}

View File

@@ -0,0 +1,19 @@
<?php
namespace Modules\CCMS\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
// use Modules\CCMS\Database\Factories\NewsletterFactory;
class Newsletter extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['email'];
}

View File

@@ -19,12 +19,10 @@ class Partner extends Model
protected $fillable = [ protected $fillable = [
'title', 'title',
'slug', 'slug',
'link',
'image', 'image',
'status', 'status',
'linka',
'order', 'order',
'createdby', 'createdby',
'updatedby', 'updatedby',
]; ];

View File

@@ -0,0 +1,21 @@
<?php
namespace Modules\CCMS\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
// use Modules\CCMS\Database\Factories\VacancyFactory;
class vacancy extends Model
{
use HasFactory;
protected $fillable = [
'first_name',
'last_name',
'email',
'phone',
'qualification',
'description',
];
}

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::table('countries', function (Blueprint $table) {
$table->longText('faqs')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('countries', function (Blueprint $table) {
$table->dropColumn('faqs');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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(): void
{
Schema::create('newsletters', function (Blueprint $table) {
$table->id();
$table->string('email')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('newsletters');
}
};

View File

@@ -0,0 +1,40 @@
<?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(): void
{
Schema::create('franchises', function (Blueprint $table) {
$table->id();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('email')->nullable();
$table->string('phone')->nullable();
$table->string('address')->nullable();
$table->string('city')->nullable();
$table->string('state')->nullable();
$table->string('invest_level')->nullable();
$table->string('own_business')->nullable();
$table->text('yes_own_des')->nullable();
$table->string('franchise_location')->nullable();
$table->string('start_time_frame')->nullable();
$table->string('office_setup')->nullable();
$table->string('website')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('franchises');
}
};

View File

@@ -0,0 +1,58 @@
<?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(): void
{
Schema::create('events', function (Blueprint $table) {
$table->id();
$table->text('title');
$table->text('slug')->nullable();
$table->text('short_description')->nullable();
$table->longText('description')->nullable();
$table->json('custom')->nullable();
$table->integer('parent_id')->unsigned()->nullable();
$table->string('image')->nullable();
$table->string('banner')->nullable();
$table->text('images')->nullable();
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
$table->text('meta_title')->nullable();
$table->text('meta_description')->nullable();
$table->text('meta_keywords')->nullable();
$table->text('sidebar_title')->nullable();
$table->mediumText('sidebar_content')->nullable();
$table->string('sidebar_image')->nullable();
$table->string('button_text')->nullable();
$table->string('button_url')->nullable();
$table->string('button_target')->nullable();
$table->integer('status')->default(1);
$table->string('icon_class')->nullable();
$table->string('icon_image')->nullable();
$table->integer('createdby')->unsigned()->nullable();
$table->integer('updatedby')->unsigned()->nullable();
$table->integer('order')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('events');
}
};

View File

@@ -0,0 +1,40 @@
<?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(): void
{
Schema::create('careers', function (Blueprint $table) {
$table->id();
$table->string('department')->nullable();
$table->string('job_title')->nullable();
$table->text('job_description')->nullable();
$table->text('job_requirements')->nullable();
$table->string('salary_range')->nullable();
$table->string('location')->nullable();
$table->string('position')->nullable();
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
$table->integer('status')->default(1);
$table->integer('createdby')->unsigned()->nullable();
$table->integer('updatedby')->unsigned()->nullable();
$table->integer('order')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('careers');
}
};

View File

@@ -0,0 +1,33 @@
<?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(): void
{
Schema::create('vacancies', function (Blueprint $table) {
$table->id();
$table->string('first_name')->nullable();
$table->string('last_name')->nullable();
$table->string('email')->nullable();
$table->string('phone')->nullable();
$table->string('qualification')->nullable();
$table->text('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('vacancies');
}
};

View File

@@ -0,0 +1,16 @@
@extends('layouts.app')
@section('content')
<x-dashboard.breadcumb :title="$title" />
<div class="container-fluid">
@if ($errors->any())
<x-flash-message type="danger" :messages="$errors->all()" />
@endif
<div class="row">
<div class="col-xl-12">
{{ html()->form('POST')->route('career.store')->class('needs-validation')->attributes(['novalidate'])->open() }}
@include('ccms::career.partials._form')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,12 @@
<div class="hstack flex-wrap gap-3">
<a href="{{ route('career.edit', $id) }}" data-bs-toggle="tooltip"
data-bs-placement="bottom" data-bs-title="Edit" class="link-success fs-15 edit-item-btn"><i
class=" ri-edit-2-line"></i></a>
<a data-link="{{ route('career.toggle', $id) }}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Toggle" data-status="{{ $status == 1 ? 'Draft' : 'Published' }}"
class="link-info fs-15 toggle-item"><i class="{{ $status == 1 ? 'ri-toggle-line' : 'ri-toggle-fill' }}"></i></a>
<a href="javascript:void(0);" data-link="{{ route('career.destroy', $id) }}" class="link-danger fs-15 remove-item"
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Delete"><i class="ri-delete-bin-6-line"></i>
</a>
</div>

View File

@@ -0,0 +1,16 @@
@extends('layouts.app')
@section('content')
<x-dashboard.breadcumb :title="$title" />
<div class="container-fluid">
@if ($errors->any())
<x-flash-message type="danger" :messages="$errors->all()" />
@endif
<div class="row">
<div class="col-xl-12">
{{ html()->modelForm($career, 'PUT')->route('career.update', $career->id)->class('needs-validation')->attributes(['novalidate'])->open() }}
@include('ccms::career.partials._form')
{{ html()->closeModelForm() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,51 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
@if ($errors->any())
<x-flash-message type="danger" :messages="$errors->all()" />
@endif
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-header d-flex align-items-center justify-content-between">
<h5 class="card-title mb-0">{{ $title }}</h5>
<a href="{{ route('career.create') }}" class="btn btn-primary waves-effect waves-light text-white"><i
class="ri-add-line align-middle"></i> Create</a>
</div>
<div class="card-body">
@php
$columns = [
[
'title' => 'S.N',
'data' => 'DT_RowIndex',
'name' => 'DT_RowIndex',
'orderable' => false,
'searchable' => false,
'sortable' => false,
],
['title' => 'Job Title', 'data' => 'job_title', 'name' => 'job_title'],
['title' => 'Start Date', 'data' => 'start_date', 'name' => 'start_date'],
['title' => 'End Date', 'data' => 'end_date', 'name' => 'end_date'],
['title' => 'Department', 'data' => 'department', 'name' => 'department'],
['title' => 'Location', 'data' => 'location', 'name' => 'location'],
['title' => 'Position', 'data' => 'position', 'name' => 'position'],
['title' => 'Salary', 'data' => 'salary_range', 'name' => 'salary_range'],
['title' => 'Status', 'data' => 'status', 'name' => 'status'],
[
'title' => 'Action',
'data' => 'action',
'orderable' => false,
'searchable' => false,
],
];
@endphp
<x-data-table-script :route="route('career.index')" :reorder="route('career.reorder')" :columns="$columns" />
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,220 @@
<div class="row">
<div class="col-xl-8">
<div class="card h-auto">
<div class="card-body">
<div class="row gy-3">
<div class="col-md-6">
{{ html()->label('Job Title')->class('form-label')->for('job_title') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('job_title')->class('form-control')->placeholder('Enter Job Title')->required(true) }}
</div>
<div class="col-md-6">
{{ html()->label('Department')->class('form-label')->for('department') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('department')->class('form-control')->placeholder('Enter Department')->required(true) }}
</div>
<div class="col-md-6">
{{ html()->label('Vacancy Start Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('start_date')->class('form-control')->id('career-start-date')->placeholder('Vacancy Start Date')->attributes([
'data-provider' => 'flatpickr',
'data-date-format' => 'Y-m-d',
'data-enable-time' => '',
])->required() }}
<span class="input-group-text"><i class="ri-calendar-career-line"></i></span>
</div>
</div>
<div class="col-md-6">
{{ html()->label('Vacancy End Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('end_date')->class('form-control')->id('career-end-date')->placeholder('Vacancy End Date')->attributes([
'data-provider' => 'flatpickr',
'data-date-format' => 'Y-m-d',
'data-enable-time' => '',
]) }}
<span class="input-group-text"><i class="ri-calendar-career-line"></i></span>
</div>
</div>
<div class="col-md-6">
{{ html()->label('Salary Range')->class('form-label')->for('salary_range') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('salary_range')->class('form-control')->placeholder('Enter Salary Range')->required(true) }}
</div>
<div class="col-md-6">
{{ html()->label('Location')->class('form-label')->for('location') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('location')->class('form-control')->placeholder('Enter location')->required(true) }}
</div>
<div class="col-12">
{{ html()->label('Position')->class('form-label')->for('position') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('position')->class('form-control')->placeholder('Enter Position (e.g. Fresher, Intermidiate, Senior)')->required(true) }}
</div>
<div class="col-12">
{{ html()->label('Job Description')->class('form-label')->for('job_description') }}
{{ html()->textarea('job_description')->class('form-control')->placeholder('Enter Job Description (JD)')->rows(5) }}
</div>
<div class="col-12">
{{ html()->label('Job Requirements')->class('form-label')->for('job_requirements') }}
{{ html()->textarea('job_requirements')->class('form-control ckeditor-classic')->placeholder('Enter Job Requirements') }}
</div>
</div>
</div>
</div>
{{-- <x-ccms::custom-form-field :data="$career->custom ?? []" /> --}}
<div class="card meta-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">Meta</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-xl-12 col-sm-12">
{{ html()->label('Meta Title')->class('form-label')->for('meta_title') }}
{{ html()->text('meta_title')->class('form-control mb-3')->placeholder('Meta Title') }}
</div>
<div class="col-xl-12 col-sm-12">
{{ html()->label('Meta Keywords')->class('form-label')->for('meta_keywords') }}
{{ html()->textarea('meta_keywords')->class('form-control mb-3')->placeholder('Meta Keywords') }}
</div>
<div class="col-xl-12 col-sm-12">
{{ html()->label('Meta Description')->class('form-label')->for('meta_description') }}
{{ html()->textarea('meta_description')->class('form-control mb-3')->placeholder('Meta wire:Description')->rows(3) }}
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-4">
<div class="card">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Published
</h6>
</div>
<div class="card-body">
{{ html()->label('Status')->class('form-label visually-hidden')->for('status') }}
{{ html()->select('status', config('constants.page_status_options'))->class('form-select choices-select') }}
</div>
<x-form-buttons :href="route('career.index')" :label="isset($career) ? 'Update' : 'Create'" />
</div>
<div class="card">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Page Attributes
</h6>
</div>
<div class="card-body">
{{ html()->label('Parent Event')->class('form-label')->for('parent_id') }}
{{ html()->select('parent_id', $careerOptions ?? [])->value($career->parent_id ?? old('parent_id'))->class('form-select choices-select')->placeholder('Select') }}
</div>
</div>
<div class="card media-gallery-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Icon
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Icon')->class('form-label')->for('icon_class') }}
{{ html()->text('icon_class')->class('form-control')->placeholder('Icon class') }}
</div>
{{ html()->label('Icon Image')->class('form-label')->for('icon_image') }}
<x-image-input :data="$editable ? $career->getRawOriginal('icon_image') : null" id="icon_image" name="icon_image" :editable="$editable" :multiple=false />
</div>
</div>
<div class="card featured-image-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Featured Image
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Featured')->class('form-label')->for('image') }}
<x-image-input :data="$editable ? $career->getRawOriginal('image') : null" id="image" name="image" :editable="$editable" :multiple=false />
</div>
{{ html()->label('Banner')->class('form-label')->for('banner') }}
<x-image-input :data="$editable ? $career->getRawOriginal('banner') : null" id="banner" name="banner" :editable="$editable" :multiple=false />
</div>
</div>
<div class="card media-gallery-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Media Gallery
</h6>
</div>
<div class="card-body">
<x-image-input :editable="$editable" id="images" name="images" :data="$editable ? $career->getRawOriginal('images') : null" :multiple="true"
label="Select Images" />
</div>
</div>
<div class="card sidebar-section">
<div class="card-header d-flex jusitfy-content-between align-items-center">
<h6 class="card-title mb-0 fs-14">Sidebar</h6>
</div>
<div class="card-body">
<div class="row gy-3">
<div class="col-lg-12">
{{ html()->label('Title')->class('form-label')->for('sidebar_title') }}
{{ html()->text('sidebar_title')->class('form-control') }}
</div>
<div class="col-lg-12">
{{ html()->label('Content')->class('form-label')->for('sidebar_content') }}
{{ html()->textarea('sidebar_content')->class('form-control')->placeholder('Short Content (optional)')->rows(3) }}
</div>
<div class="col-lg-12">
{{ html()->label('Image')->class('form-label')->for('sidebar_content') }}
<x-image-input :data="$editable ? $career->getRawOriginal('sidebar_image') : null" id="sidebar_image" name="sidebar_image" :editable="$editable"
:multiple=false />
</div>
</div>
</div>
</div>
<div class="card button-section">
<div class="card-header d-flex jusitfy-content-between align-items-center">
<h6 class="card-title mb-0 fs-14">Button</h6>
</div>
<div class="card-body">
<div class="row gy-3">
<div class="col-lg-12">
{{ html()->label('Text')->class('form-label')->for('button_text') }}
{{ html()->text('button_text')->class('form-control') }}
</div>
<div class="col-lg-12">
{{ html()->label('Link')->class('form-label')->for('button_url') }}
{{ html()->text('button_url')->class('form-control')->placeholder('Button Link') }}
</div>
<div class="col-lg-12">
{{ html()->label('Target')->class('form-label')->for('button_target') }}
{{ html()->select('button_target', config('constants.redirect_options'))->class('form-select choices-select') }}
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -10,12 +10,13 @@
@php @php
$columns = [ $columns = [
[ [
'title' => 'S.N', 'title' => '<input type="checkbox" id="select-all">',
'data' => 'DT_RowIndex', 'data' => 'checkbox',
'name' => 'DT_RowIndex', 'name' => 'checkbox',
'orderable' => false, 'orderable' => false,
'searchable' => false, 'searchable' => false,
'sortable' => false, 'className' => 'align-middle',
'width' => '1%',
], ],
['title' => 'Name', 'data' => 'name', 'name' => 'name'], ['title' => 'Name', 'data' => 'name', 'name' => 'name'],
['title' => 'Email', 'data' => 'email', 'name' => 'email'], ['title' => 'Email', 'data' => 'email', 'name' => 'email'],
@@ -32,6 +33,20 @@
@endphp @endphp
<x-data-table-script :route="route('counselor.index')" :reorder="null" :columns="$columns" /> <x-data-table-script :route="route('counselor.index')" :reorder="null" :columns="$columns" />
</div> </div>
<div class="card" id="customerList">
<div class="card-body p-2">
{{-- <div class="table-responsive">
{{ $dataTable->table(['class' => 'table table-sm w-100', 'data-is_enrolled' => $is_enrolled], true) }}
</div> --}}
<div class="row mt-3">
<div class="col-md-3">
{{ html()->select('action', [2 => 'Send News Letter', 3 => 'Send Mail'])->placeholder('Bulk Actions')->class('form-select bulk-select') }}
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
@endsection @endsection

View File

@@ -19,6 +19,11 @@
{{ html()->span('*')->class('text-danger') }} {{ html()->span('*')->class('text-danger') }}
{{ html()->textarea('description')->class('form-control ckeditor-classic')->placeholder('Enter Country Description')->required() }} {{ html()->textarea('description')->class('form-control ckeditor-classic')->placeholder('Enter Country Description')->required() }}
</div> </div>
<div class="col-12">
{{ html()->label('Extra FAQs')->class('form-label')->for('faqs') }}
{{ html()->textarea('faqs')->class('form-control ckeditor-classic')->placeholder('Enter Extra FAQs')->required() }}
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -87,13 +92,11 @@
<div class="card-body"> <div class="card-body">
<div class="mb-3"> <div class="mb-3">
{{ html()->label('Featured')->class('form-label')->for('image') }} {{ html()->label('Featured')->class('form-label')->for('image') }}
<x-image-input :data="$editable ? $country->getRawOriginal('image') : null" id="image" name="image" :editable="$editable" <x-image-input :data="$editable ? $country->getRawOriginal('image') : null" id="image" name="image" :editable="$editable" :multiple=false />
:multiple=false />
</div> </div>
{{ html()->label('Banner')->class('form-label')->for('banner') }} {{ html()->label('Banner')->class('form-label')->for('banner') }}
<x-image-input :data="$editable ? $country->getRawOriginal('banner') : null" id="banner" name="banner" :editable="$editable" <x-image-input :data="$editable ? $country->getRawOriginal('banner') : null" id="banner" name="banner" :editable="$editable" :multiple=false />
:multiple=false />
</div> </div>
</div> </div>

View File

@@ -8,18 +8,21 @@
</div> </div>
<div class="card-body"> <div class="card-body">
@php @php
// IMPORTANT: 'data' must match the key returned by DataTables JSON.
// Your controller uses ->addColumn('checkbox', ...), so use 'checkbox' here.
$columns = [ $columns = [
[ [
'title' => 'S.N', 'title' => '<input type="checkbox" id="select-all">',
'data' => 'DT_RowIndex', 'data' => 'checkbox', // <-- was 'select'
'name' => 'DT_RowIndex', 'name' => 'checkbox',
'orderable' => false, 'orderable' => false,
'searchable' => false, 'searchable' => false,
'sortable' => false, 'className' => 'align-middle',
'width' => '1%',
], ],
['title' => 'Name', 'data' => 'name', 'name' => 'name'], ['title' => 'Name', 'data' => 'name', 'name' => 'name'],
['title' => 'Email', 'data' => 'email', 'name' => 'email'], ['title' => 'Email', 'data' => 'email', 'name' => 'email'],
['title' => 'Contact', 'data' => 'mobile', 'name' => 'mobile'], ['title' => 'Mobile', 'data' => 'mobile', 'name' => 'mobile'],
['title' => 'Class', 'data' => 'class', 'name' => 'class'], ['title' => 'Class', 'data' => 'class', 'name' => 'class'],
['title' => 'Subject', 'data' => 'subject', 'name' => 'subject'], ['title' => 'Subject', 'data' => 'subject', 'name' => 'subject'],
['title' => 'Message', 'data' => 'message', 'name' => 'message'], ['title' => 'Message', 'data' => 'message', 'name' => 'message'],
@@ -31,8 +34,72 @@
], ],
]; ];
@endphp @endphp
<x-data-table-script :route="route('enquiry.index')" :reorder="null" :columns="$columns" /> <x-data-table-script :route="route('enquiry.index')" :reorder="null" :columns="$columns" />
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection
@push('js')
<script>
$(function () {
// Initialize DataTable ONCE on the correct selector
const enquiryTable = $('.ajax-datatable').DataTable({
columnDefs: [
{ targets: 0, orderable: false, searchable: false } // disable checkbox col
]
});
// Keep master checkbox cleared on redraws (pagination/filtering)
enquiryTable.on('draw', function () {
$('#select-all').prop('checked', false);
});
// Select/Deselect all (current page rows)
$(document).on('change', '#select-all', function () {
const checked = this.checked;
const rows = enquiryTable.rows({ page: 'current' }).nodes();
$('.enquiry-select', rows).prop('checked', checked);
});
// When any row checkbox changes, sync master checkbox state for current page
$(document).on('change', '.enquiry-select', function () {
const rows = enquiryTable.rows({ page: 'current' }).nodes();
const total = $('.enquiry-select', rows).length;
const checked = $('.enquiry-select:checked', rows).length;
$('#select-all').prop('checked', total > 0 && checked === total);
});
// Bulk action (optional)
$('.bulk-select').on('change', function () {
const action = $(this).val();
const ids = $('.enquiry-select:checked').map(function () { return this.value; }).get();
if (!ids.length) {
alert('Please select at least one enquiry.');
$(this).val('');
return;
}
if (action == 2 || action == 3) {
$.ajax({
url: "{{ route('enquiry.bulkAction') }}",
method: "POST",
data: {
_token: "{{ csrf_token() }}",
action: action,
ids: ids
},
success: function (res) {
alert(res.message);
enquiryTable.ajax.reload(null, false); // keep page
$('.bulk-select').val('');
$('#select-all').prop('checked', false);
}
});
}
});
});
</script>
@endpush

View File

@@ -0,0 +1,16 @@
@extends('layouts.app')
@section('content')
<x-dashboard.breadcumb :title="$title" />
<div class="container-fluid">
@if ($errors->any())
<x-flash-message type="danger" :messages="$errors->all()" />
@endif
<div class="row">
<div class="col-xl-12">
{{ html()->form('POST')->route('event.store')->class('needs-validation')->attributes(['novalidate'])->open() }}
@include('ccms::event.partials._form')
{{ html()->form()->close() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,12 @@
<div class="hstack flex-wrap gap-3">
<a href="{{ route('event.edit', $id) }}" data-bs-toggle="tooltip"
data-bs-placement="bottom" data-bs-title="Edit" class="link-success fs-15 edit-item-btn"><i
class=" ri-edit-2-line"></i></a>
<a data-link="{{ route('event.toggle', $id) }}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Toggle" data-status="{{ $status == 1 ? 'Draft' : 'Published' }}"
class="link-info fs-15 toggle-item"><i class="{{ $status == 1 ? 'ri-toggle-line' : 'ri-toggle-fill' }}"></i></a>
<a href="javascript:void(0);" data-link="{{ route('event.destroy', $id) }}" class="link-danger fs-15 remove-item"
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Delete"><i class="ri-delete-bin-6-line"></i>
</a>
</div>

View File

@@ -0,0 +1,16 @@
@extends('layouts.app')
@section('content')
<x-dashboard.breadcumb :title="$title" />
<div class="container-fluid">
@if ($errors->any())
<x-flash-message type="danger" :messages="$errors->all()" />
@endif
<div class="row">
<div class="col-xl-12">
{{ html()->modelForm($event, 'PUT')->route('event.update', $event->id)->class('needs-validation')->attributes(['novalidate'])->open() }}
@include('ccms::event.partials._form')
{{ html()->closeModelForm() }}
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,49 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
@if ($errors->any())
<x-flash-message type="danger" :messages="$errors->all()" />
@endif
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-header d-flex align-items-center justify-content-between">
<h5 class="card-title mb-0">{{ $title }}</h5>
<a href="{{ route('event.create') }}" class="btn btn-primary waves-effect waves-light text-white"><i
class="ri-add-line align-middle"></i> Create</a>
</div>
<div class="card-body">
@php
$columns = [
[
'title' => 'S.N',
'data' => 'DT_RowIndex',
'name' => 'DT_RowIndex',
'orderable' => false,
'searchable' => false,
'sortable' => false,
],
['title' => 'Image', 'data' => 'image', 'name' => 'image'],
['title' => 'Title', 'data' => 'title', 'name' => 'title'],
['title' => 'Start Date', 'data' => 'start_date', 'name' => 'start_date'],
['title' => 'End Date', 'data' => 'end_date', 'name' => 'end_date'],
['title' => 'Slug', 'data' => 'slug', 'name' => 'slug'],
['title' => 'Status', 'data' => 'status', 'name' => 'status'],
[
'title' => 'Action',
'data' => 'action',
'orderable' => false,
'searchable' => false,
],
];
@endphp
<x-data-table-script :route="route('event.index')" :reorder="route('event.reorder')" :columns="$columns" />
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,196 @@
<div class="row">
<div class="col-xl-8">
<div class="card h-auto">
<div class="card-body">
<div class="row gy-3">
<div class="col-12">
{{ html()->label('Title')->class('form-label')->for('title') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Event Title')->required(true) }}
</div>
<div class="col-md-6">
{{ html()->label('Start Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('start_date')->class('form-control')->id('event-start-date')->placeholder('Event Start Date')->attributes([
'data-provider' => 'flatpickr',
'data-date-format' => 'Y-m-d',
'data-enable-time' => '',
])->required() }}
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
</div>
</div>
<div class="col-md-6">
{{ html()->label('End Date')->class('form-label') }}
<div class="input-group">
{{ html()->text('end_date')->class('form-control')->id('event-end-date')->placeholder('Event End Date')->attributes([
'data-provider' => 'flatpickr',
'data-date-format' => 'Y-m-d',
'data-enable-time' => '',
]) }}
<span class="input-group-text"><i class="ri-calendar-event-line"></i></span>
</div>
</div>
<div class="col-12">
{{ html()->label('Description (Short)')->class('form-label')->for('short_description') }}
{{ html()->textarea('short_description')->class('form-control')->placeholder('Enter Description (Short)')->rows(5) }}
</div>
<div class="col-12">
{{ html()->label('Description')->class('form-label')->for('description') }}
{{ html()->textarea('description')->class('form-control ckeditor-classic')->placeholder('Enter Description') }}
</div>
</div>
</div>
</div>
<x-ccms::custom-form-field :data="$event->custom ?? []" />
<div class="card meta-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">Meta</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-xl-12 col-sm-12">
{{ html()->label('Meta Title')->class('form-label')->for('meta_title') }}
{{ html()->text('meta_title')->class('form-control mb-3')->placeholder('Meta Title') }}
</div>
<div class="col-xl-12 col-sm-12">
{{ html()->label('Meta Keywords')->class('form-label')->for('meta_keywords') }}
{{ html()->textarea('meta_keywords')->class('form-control mb-3')->placeholder('Meta Keywords') }}
</div>
<div class="col-xl-12 col-sm-12">
{{ html()->label('Meta Description')->class('form-label')->for('meta_description') }}
{{ html()->textarea('meta_description')->class('form-control mb-3')->placeholder('Meta wire:Description')->rows(3) }}
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-4">
<div class="card">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Published
</h6>
</div>
<div class="card-body">
{{ html()->label('Status')->class('form-label visually-hidden')->for('status') }}
{{ html()->select('status', config('constants.page_status_options'))->class('form-select choices-select') }}
</div>
<x-form-buttons :href="route('event.index')" :label="isset($event) ? 'Update' : 'Create'" />
</div>
<div class="card">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Page Attributes
</h6>
</div>
<div class="card-body">
{{ html()->label('Parent Event')->class('form-label')->for('parent_id') }}
{{ html()->select('parent_id', $eventOptions ?? [])->value($event->parent_id ?? old('parent_id'))->class('form-select choices-select')->placeholder('Select') }}
</div>
</div>
<div class="card media-gallery-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Icon
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Icon')->class('form-label')->for('icon_class') }}
{{ html()->text('icon_class')->class('form-control')->placeholder('Icon class') }}
</div>
{{ html()->label('Icon Image')->class('form-label')->for('icon_image') }}
<x-image-input :data="$editable ? $event->getRawOriginal('icon_image') : null" id="icon_image" name="icon_image" :editable="$editable" :multiple=false />
</div>
</div>
<div class="card featured-image-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Featured Image
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Featured')->class('form-label')->for('image') }}
<x-image-input :data="$editable ? $event->getRawOriginal('image') : null" id="image" name="image" :editable="$editable" :multiple=false />
</div>
{{ html()->label('Banner')->class('form-label')->for('banner') }}
<x-image-input :data="$editable ? $event->getRawOriginal('banner') : null" id="banner" name="banner" :editable="$editable" :multiple=false />
</div>
</div>
<div class="card media-gallery-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Media Gallery
</h6>
</div>
<div class="card-body">
<x-image-input :editable="$editable" id="images" name="images" :data="$editable ? $event->getRawOriginal('images') : null" :multiple="true"
label="Select Images" />
</div>
</div>
<div class="card sidebar-section">
<div class="card-header d-flex jusitfy-content-between align-items-center">
<h6 class="card-title mb-0 fs-14">Sidebar</h6>
</div>
<div class="card-body">
<div class="row gy-3">
<div class="col-lg-12">
{{ html()->label('Title')->class('form-label')->for('sidebar_title') }}
{{ html()->text('sidebar_title')->class('form-control') }}
</div>
<div class="col-lg-12">
{{ html()->label('Content')->class('form-label')->for('sidebar_content') }}
{{ html()->textarea('sidebar_content')->class('form-control')->placeholder('Short Content (optional)')->rows(3) }}
</div>
<div class="col-lg-12">
{{ html()->label('Image')->class('form-label')->for('sidebar_content') }}
<x-image-input :data="$editable ? $event->getRawOriginal('sidebar_image') : null" id="sidebar_image" name="sidebar_image" :editable="$editable"
:multiple=false />
</div>
</div>
</div>
</div>
<div class="card button-section">
<div class="card-header d-flex jusitfy-content-between align-items-center">
<h6 class="card-title mb-0 fs-14">Button</h6>
</div>
<div class="card-body">
<div class="row gy-3">
<div class="col-lg-12">
{{ html()->label('Text')->class('form-label')->for('button_text') }}
{{ html()->text('button_text')->class('form-control') }}
</div>
<div class="col-lg-12">
{{ html()->label('Link')->class('form-label')->for('button_url') }}
{{ html()->text('button_url')->class('form-control')->placeholder('Button Link') }}
</div>
<div class="col-lg-12">
{{ html()->label('Target')->class('form-label')->for('button_target') }}
{{ html()->select('button_target', config('constants.redirect_options'))->class('form-select choices-select') }}
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
{{ html()->form('POST')->route('testimonial.store')->class(['needs-validation'])->attributes(['enctype' => 'multipart/form-data', 'novalidate'])->open() }}
@include('ccms::testimonial.partials._form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -0,0 +1,10 @@
<div class="hstack flex-wrap gap-3">
{{-- <a data-link="{{ route('franchise.markAsRead', $id) }}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Mark as {{ $is_read == 1 ? 'unread' : 'read' }}" data-status="{{ $is_read == 1 ? 'read' : 'unread' }}" --}}
{{-- class="fs-15 mark-item"><i class="{{ $is_read == 1 ? ' ri-mail-close-line link-secondary' : ' ri-mail-check-line link-success' }}"></i></a> --}}
<a href="javascript:void(0);" data-link="{{ route('franchise.destroy', $id) }}" class="link-danger fs-15 remove-item" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Delete">
<i class="ri-delete-bin-6-line"></i>
</a>
</div>

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
{{ html()->modelForm($testimonial, 'PUT')->route('testimonial.update', $testimonial->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('ccms::testimonial.partials._form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -0,0 +1,60 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
</div>
<div class="card-body">
@php
$columns = [
[
'title' => '<input type="checkbox" id="select-all">',
'data' => 'checkbox',
'name' => 'checkbox',
'orderable' => false,
'searchable' => false,
'className' => 'align-middle',
'width' => '1%',
],
['title' => 'First Name', 'data' => 'first_name', 'name' => 'first_name'],
['title' => 'Last Name', 'data' => 'last_name', 'name' => 'first_name'],
['title' => 'Email', 'data' => 'email', 'name' => 'email'],
['title' => 'Phone', 'data' => 'phone', 'name' => 'phone'],
['title' => 'Address', 'data' => 'address', 'name' => 'address'],
['title' => 'City', 'data' => 'city', 'name' => 'city'],
['title' => 'State', 'data' => 'state', 'name' => 'state'],
['title' => 'Invest Level', 'data' => 'invest_level', 'name' => 'invest_level'],
[
'title' => 'Franchise Location',
'data' => 'franchise_location',
'name' => 'franchise_location',
],
[
'title' => 'Action',
'data' => 'action',
'orderable' => false,
'searchable' => false,
],
];
@endphp
<x-data-table-script :route="route('franchise.index')" :reorder="null" :columns="$columns" />
</div>
<div class="card" id="customerList">
<div class="card-body p-2">
{{-- <div class="table-responsive">
{{ $dataTable->table(['class' => 'table table-sm w-100', 'data-is_enrolled' => $is_enrolled], true) }}
</div> --}}
<div class="row mt-3">
<div class="col-md-3">
{{ html()->select('action', [2 => 'Send News Letter', 3 => 'Send Mail'])->placeholder('Bulk Actions')->class('form-select bulk-select') }}
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,71 @@
<div class="row">
<div class="col-lg-8 col-xl-9">
<div class="card">
<div class="card-body">
<div class="row gy-3">
<div class="col-md-6">
{{ html()->label('Name')->class('form-label') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Name')->required() }}
{{ html()->div('Name is required')->class('invalid-feedback') }}
</div>
<div class="col-md-6">
{{ html()->label('Designation')->class('form-label') }}
{{ html()->text('designation')->class('form-control')->placeholder('Enter Designation') }}
</div>
<div class="col-md-6">
{{ html()->label('Company')->class('form-label') }}
{{ html()->text('company')->class('form-control')->placeholder('Enter Company') }}
</div>
<div class="col-lg-6">
{{ html()->label('Branch')->class('form-label')->for('branch_id') }}
{{ html()->select('branch_id', $branchOptions)->class('form-select choices-select')->placeholder('Select') }}
</div>
<div class="col-12">
{{ html()->label('Comment')->class('form-label')->for('description') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->textarea('description')->class('form-control')->rows(10) }}
</div>
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-4 col-xl-3">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Publish</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->select('status', config('constants.page_status_options'))->class('form-select choices-select ') }}
</div>
</div>
</div>
<!-- end card body -->
<x-form-buttons :editable="$editable" label="Save" href="{{ route('team.index') }}" />
</div>
<div class="card featured-image-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Featured
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Image')->class('form-label')->for('image') }}
<x-image-input :editable="$editable" id="image" name="image" :data="$editable ? $testimonial->getRawOriginal('image') : null"
:multiple="false" />
</div>
</div>
</div>
</div>
<!-- end col -->
</div>

View File

@@ -26,9 +26,9 @@
</div> </div>
<div class="mb-3"> <div class="mb-3">
{{ html()->label('Video Link')->for('slug') }} {{ html()->label('Description')->for('slug') }}
{{ html()->text('link')->value($gallery->link ?? old('link'))->class('form-control')->placeholder('Enter Youtube video link') }} {{ html()->text('link')->value($gallery->link ?? old('link'))->class('form-control')->placeholder('Enter Video Description') }}
<div class="d-flex flex-wrap mt-1" id="video-preview"> <div class="d-flex flex-wrap mt-1">
</div> </div>
</div> </div>

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
{{ html()->form('POST')->route('testimonial.store')->class(['needs-validation'])->attributes(['enctype' => 'multipart/form-data', 'novalidate'])->open() }}
@include('ccms::testimonial.partials._form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -0,0 +1,8 @@
<div class="hstack flex-wrap gap-3">
<a href="javascript:void(0);" data-link="{{ route('newsletter.destroy', $id) }}" class="link-danger fs-15 remove-item"
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Delete">
<i class="ri-delete-bin-6-line"></i>
</a>
</div>

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
{{ html()->modelForm($testimonial, 'PUT')->route('testimonial.update', $testimonial->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('ccms::testimonial.partials._form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -0,0 +1,48 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
</div>
<div class="card-body">
@php
$columns = [
[
'title' => '<input type="checkbox" id="select-all">',
'data' => 'checkbox',
'name' => 'checkbox',
'orderable' => false,
'searchable' => false,
'className' => 'align-middle',
'width' => '1%',
],
['title' => 'Email', 'data' => 'email', 'name' => 'email'],
[
'title' => 'Action',
'data' => 'action',
'orderable' => false,
'searchable' => false,
],
];
@endphp
<x-data-table-script :route="route('newsletter.index')" :reorder="null" :columns="$columns" />
</div>
<div class="card" id="customerList">
<div class="card-body p-2">
{{-- <div class="table-responsive">
{{ $dataTable->table(['class' => 'table table-sm w-100', 'data-is_enrolled' => $is_enrolled], true) }}
</div> --}}
<div class="row mt-3">
<div class="col-md-3">
{{ html()->select('action', [2 => 'Send News Letter', 3 => 'Send Mail'])->placeholder('Bulk Actions')->class('form-select bulk-select') }}
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,71 @@
<div class="row">
<div class="col-lg-8 col-xl-9">
<div class="card">
<div class="card-body">
<div class="row gy-3">
<div class="col-md-6">
{{ html()->label('Name')->class('form-label') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->text('title')->class('form-control')->placeholder('Enter Name')->required() }}
{{ html()->div('Name is required')->class('invalid-feedback') }}
</div>
<div class="col-md-6">
{{ html()->label('Designation')->class('form-label') }}
{{ html()->text('designation')->class('form-control')->placeholder('Enter Designation') }}
</div>
<div class="col-md-6">
{{ html()->label('Company')->class('form-label') }}
{{ html()->text('company')->class('form-control')->placeholder('Enter Company') }}
</div>
<div class="col-lg-6">
{{ html()->label('Branch')->class('form-label')->for('branch_id') }}
{{ html()->select('branch_id', $branchOptions)->class('form-select choices-select')->placeholder('Select') }}
</div>
<div class="col-12">
{{ html()->label('Comment')->class('form-label')->for('description') }}
{{ html()->span('*')->class('text-danger') }}
{{ html()->textarea('description')->class('form-control')->rows(10) }}
</div>
</div>
</div>
</div>
</div>
<!-- end col -->
<div class="col-lg-4 col-xl-3">
<div class="card">
<div class="card-header">
<h5 class="card-title mb-0">Publish</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12">
{{ html()->select('status', config('constants.page_status_options'))->class('form-select choices-select ') }}
</div>
</div>
</div>
<!-- end card body -->
<x-form-buttons :editable="$editable" label="Save" href="{{ route('team.index') }}" />
</div>
<div class="card featured-image-section">
<div class="card-header">
<h6 class="card-title mb-0 fs-14">
Featured
</h6>
</div>
<div class="card-body">
<div class="mb-3">
{{ html()->label('Image')->class('form-label')->for('image') }}
<x-image-input :editable="$editable" id="image" name="image" :data="$editable ? $testimonial->getRawOriginal('image') : null"
:multiple="false" />
</div>
</div>
</div>
</div>
<!-- end col -->
</div>

View File

@@ -29,7 +29,7 @@
], ],
['title' => 'Image', 'data' => 'image', 'name' => 'image'], ['title' => 'Image', 'data' => 'image', 'name' => 'image'],
['title' => 'Name', 'data' => 'title', 'name' => 'title'], ['title' => 'Name', 'data' => 'title', 'name' => 'title'],
['title' => 'Link', 'data' => 'link', 'name' => 'link'], ['title' => 'Link', 'data' => 'linka', 'name' => 'linka'],
['title' => 'Status', 'data' => 'status', 'name' => 'status'], ['title' => 'Status', 'data' => 'status', 'name' => 'status'],
[ [
'title' => 'Action', 'title' => 'Action',

View File

@@ -0,0 +1,8 @@
<div class="hstack flex-wrap gap-3">
<a href="javascript:void(0);" data-link="{{ route('vacancy.destroy', $id) }}" class="link-danger fs-15 remove-item"
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Delete">
<i class="ri-delete-bin-6-line"></i>
</a>
</div>

View File

@@ -0,0 +1,52 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
<div class="card">
<div class="card-header align-items-center d-flex">
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
</div>
<div class="card-body">
@php
$columns = [
[
'title' => '<input type="checkbox" id="select-all">',
'data' => 'checkbox',
'name' => 'checkbox',
'orderable' => false,
'searchable' => false,
'className' => 'align-middle',
'width' => '1%',
],
['title' => 'First Name', 'data' => 'first_name', 'name' => 'first_name'],
['title' => 'Last Name', 'data' => 'last_name', 'name' => 'last_name'],
['title' => 'Email', 'data' => 'email', 'name' => 'email'],
['title' => 'Phone', 'data' => 'phone', 'name' => 'phone'],
['title' => 'Qualification', 'data' => 'qualification', 'name' => 'qualification'],
[
'title' => 'Action',
'data' => 'action',
'orderable' => false,
'searchable' => false,
],
];
@endphp
<x-data-table-script :route="route('vacancy.index')" :reorder="null" :columns="$columns" />
</div>
<div class="card" id="customerList">
<div class="card-body p-2">
{{-- <div class="table-responsive">
{{ $dataTable->table(['class' => 'table table-sm w-100', 'data-is_enrolled' => $is_enrolled], true) }}
</div> --}}
<div class="row mt-3">
<div class="col-md-3">
{{ html()->select('action', [2 => 'Send News Letter', 3 => 'Send Mail'])->placeholder('Bulk Actions')->class('form-select bulk-select') }}
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
{{ html()->form('POST')->route('testimonial.store')->class(['needs-validation'])->attributes(['enctype' => 'multipart/form-data', 'novalidate'])->open() }}
@include('ccms::testimonial.partials._form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -0,0 +1,14 @@
@extends('layouts.app')
@section('content')
<div class="container-fluid">
<x-dashboard.breadcumb :title="$title" />
{{ html()->modelForm($testimonial, 'PUT')->route('testimonial.update', $testimonial->id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
@include('ccms::testimonial.partials._form')
{{ html()->form()->close() }}
</div>
@endsection

View File

@@ -3,16 +3,20 @@
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Modules\CCMS\Http\Controllers\BlogController; use Modules\CCMS\Http\Controllers\BlogController;
use Modules\CCMS\Http\Controllers\BranchController; use Modules\CCMS\Http\Controllers\BranchController;
use Modules\CCMS\Http\Controllers\CareerController;
use Modules\CCMS\Http\Controllers\CategoryController; use Modules\CCMS\Http\Controllers\CategoryController;
use Modules\CCMS\Http\Controllers\CounselorController; use Modules\CCMS\Http\Controllers\CounselorController;
use Modules\CCMS\Http\Controllers\CounterController; use Modules\CCMS\Http\Controllers\CounterController;
use Modules\CCMS\Http\Controllers\CountryController; use Modules\CCMS\Http\Controllers\CountryController;
use Modules\CCMS\Http\Controllers\EnquiryController; use Modules\CCMS\Http\Controllers\EnquiryController;
use Modules\CCMS\Http\Controllers\EventController;
use Modules\CCMS\Http\Controllers\FaqCategoryController; use Modules\CCMS\Http\Controllers\FaqCategoryController;
use Modules\CCMS\Http\Controllers\FaqController; use Modules\CCMS\Http\Controllers\FaqController;
use Modules\CCMS\Http\Controllers\FranchiseController;
use Modules\CCMS\Http\Controllers\GalleryCategoryController; use Modules\CCMS\Http\Controllers\GalleryCategoryController;
use Modules\CCMS\Http\Controllers\GalleryController; use Modules\CCMS\Http\Controllers\GalleryController;
use Modules\CCMS\Http\Controllers\InstitutionController; use Modules\CCMS\Http\Controllers\InstitutionController;
use Modules\CCMS\Http\Controllers\NewsletterController;
use Modules\CCMS\Http\Controllers\PageController; use Modules\CCMS\Http\Controllers\PageController;
use Modules\CCMS\Http\Controllers\PartnerController; use Modules\CCMS\Http\Controllers\PartnerController;
use Modules\CCMS\Http\Controllers\PopupController; use Modules\CCMS\Http\Controllers\PopupController;
@@ -22,6 +26,7 @@ use Modules\CCMS\Http\Controllers\SliderController;
use Modules\CCMS\Http\Controllers\TeamController; use Modules\CCMS\Http\Controllers\TeamController;
use Modules\CCMS\Http\Controllers\TestController; use Modules\CCMS\Http\Controllers\TestController;
use Modules\CCMS\Http\Controllers\TestimonialController; use Modules\CCMS\Http\Controllers\TestimonialController;
use Modules\CCMS\Http\Controllers\VacancyController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -31,7 +36,7 @@ use Modules\CCMS\Http\Controllers\TestimonialController;
| Here is where you can register web routes for your application. These | Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which | routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great! | contains the "web" middleware group. Now create something great!
| |Eventcontr
*/ */
Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/'], function () { Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/'], function () {
@@ -83,6 +88,14 @@ Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/
Route::get('service/toggle/{id}', [ServiceController::class, 'toggle'])->name('service.toggle'); Route::get('service/toggle/{id}', [ServiceController::class, 'toggle'])->name('service.toggle');
Route::resource('service', ServiceController::class)->names('service'); Route::resource('service', ServiceController::class)->names('service');
Route::post('event/reorder', [EventController::class, 'reorder'])->name('event.reorder');
Route::get('event/toggle/{id}', [EventController::class, 'toggle'])->name('event.toggle');
Route::resource('event', EventController::class)->names('event');
Route::post('career/reorder', [CareerController::class, 'reorder'])->name('career.reorder');
Route::get('career/toggle/{id}', [CareerController::class, 'toggle'])->name('career.toggle');
Route::resource('career', CareerController::class)->names('career');
Route::post('branch/reorder', [BranchController::class, 'reorder'])->name('branch.reorder'); Route::post('branch/reorder', [BranchController::class, 'reorder'])->name('branch.reorder');
Route::get('branch/toggle/{id}', [BranchController::class, 'toggle'])->name('branch.toggle'); Route::get('branch/toggle/{id}', [BranchController::class, 'toggle'])->name('branch.toggle');
Route::resource('branch', BranchController::class)->names('branch'); Route::resource('branch', BranchController::class)->names('branch');
@@ -121,8 +134,13 @@ Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/
Route::get('institution/toggle/{id}', [InstitutionController::class, 'toggle'])->name('institution.toggle'); Route::get('institution/toggle/{id}', [InstitutionController::class, 'toggle'])->name('institution.toggle');
Route::resource('institution', InstitutionController::class)->names('institution')->only(['store', 'edit', 'destroy']); Route::resource('institution', InstitutionController::class)->names('institution')->only(['store', 'edit', 'destroy']);
Route::post('/enquiry/bulk-action', [EnquiryController::class, 'bulkAction'])->name('enquiry.bulkAction');
Route::get('enquiry/mark-as-read/{id}', [EnquiryController::class, 'markAsRead'])->name('enquiry.markAsRead'); Route::get('enquiry/mark-as-read/{id}', [EnquiryController::class, 'markAsRead'])->name('enquiry.markAsRead');
Route::resource('enquiry', EnquiryController::class)->names('enquiry')->only(['index', 'store', 'destroy']); Route::resource('enquiry', EnquiryController::class)->names('enquiry')->only(['index', 'store', 'destroy']);
Route::resource('franchise', FranchiseController::class)->names('franchise')->only(['index', 'store', 'destroy']);
Route::resource('newsletter', NewsletterController::class)->names('newsletter')->only(['index', 'store', 'destroy']);
Route::resource('vacancy', VacancyController::class)->names('vacancy')->only(['index', 'store', 'destroy']);
Route::resource('counselor', CounselorController::class)->names('counselor')->only(['index', 'store', 'destroy']); Route::resource('counselor', CounselorController::class)->names('counselor')->only(['index', 'store', 'destroy']);
}); });

View File

@@ -0,0 +1,249 @@
<?php
namespace Modules\Chatbot\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Http\Client\RequestException;
class ChatbotController extends Controller
{
public function index()
{
return view('chatbot::index');
}
public function create()
{
return view('chatbot::create');
}
public function store(Request $request)
{
//
}
public function show($id)
{
return view('chatbot::show');
}
public function edit($id)
{
return view('chatbot::edit');
}
public function update(Request $request, $id)
{
//
}
public function destroy($id)
{
//
}
public function queryold(Request $request)
{
$message = $request->input('message');
return response()->json(['reply' => 'You said: ' . $message]);
}
// public function query(Request $request)
// {
// $request->validate([
// 'message' => 'required|string'
// ]);
// // 1) Pull the current contact details from settings
// $phone = setting('phone'); // e.g. "5344710"
// $email = setting('email'); // e.g. "info@rohini.edu.np"
// $address = setting('address'); // e.g. "House #160, Adwait Marg, Putalisadak, Kathmandu, Nepal"
// $facebook = setting('facebook'); // if you have this
// $whatsapp = setting('whatsapp'); // if you have this
// $userMessage = trim($request->message);
// // 2) Build a system prompt that *includes* your real contact info
// $systemContents = <<<EOT
// You are an assistant for Rohini International Education Services in Nepal.
// Use *only* the following facts when answering:
// • Website: https://rohini.edu.np/
// • Phone: {$phone}
// • Email: {$email}
// • Address: {$address}
// EOT;
// // 3) Prepare the message payload
// $messages = [
// ['role' => 'system', 'content' => $systemContents],
// ['role' => 'user', 'content' => $userMessage],
// ];
// // 4) Call the AI as before
// try {
// $response = Http::timeout(60)
// ->retry(2, 100)
// ->withToken(config('services.openrouter.key'))
// ->post('https://openrouter.ai/api/v1/chat/completions', [
// 'model' => 'deepseek/deepseek-r1:free',
// 'messages' => $messages,
// ]);
// $response->throw();
// // 5) Return exactly what the AI gave, knowing the system prompt constrained it
// return response()->json([
// 'reply' => $response->json('choices.0.message.content') ?? 'No response from assistant.'
// ]);
// } catch (ConnectionException $e) {
// return response()->json([
// 'reply' => 'Sorry, I could not connect to the AI service. Please try again later.'
// ], 504);
// } catch (RequestException $e) {
// $msg = $e->response->json('error.message') ?? $e->getMessage();
// return response()->json([
// 'reply' => 'Sorry, an error occurred. Please try again later.',
// 'error' => $msg
// ], 500);
// }
// }
public function query(Request $request)
{
$request->validate([
'message' => 'required|string'
]);
// 1) Pull the current contact details from your settings/config
$phone = setting('phone'); // e.g. "+977 1-5344710"
$email = setting('email'); // e.g. "info@rohini.edu.np"
$address = setting('address'); // e.g. "House #160, Adait Marg, Kathmandu, Nepal"
$whatsapp = setting('whatsapp');
$instagram = setting('instagram');
$location = setting('location');
$youtube = setting('youtube');
$tiktok = setting('tiktok');
$userMessage = strtolower(trim($request->message));
$contactInfo = "\n\nPlease contact us for more information. Visit <a href=\"https://rohini.edu.np/\" target=\"_blank\">https://rohini.edu.np/</a> or call us on " . $phone . ".";
$allowedPrompts = [
'hi' => 'Hello! How can I assist you with your study abroad plans today?',
'what is rohini international education services?' =>
'Rohini International Education Services is a Nepal-based consultancy specializing in guiding students who want to study in New Zealand. Visit https://rohini.edu.np/ for more details.',
'where is rohini international located?' =>
'Our Kathmandu office is at ' . $address . '.',
'how can i contact support?' =>
'You can call us at ' . $phone . ', email us at ' . $email .
', or message us on WhatsApp at ' . $whatsapp . '. We are available Sunday to Friday, 09:00 AM to 05:00 PM.',
'what services do you provide?' =>
'We provide counseling, university and course selection, visa application support, documentation help, pre-departure briefings, financial and scholarship guidance, and accommodation support for students going to New Zealand.',
'do you offer test preparation?' =>
'Yes, we offer IELTS and PTE test preparation classes with experienced instructors and flexible schedules.',
'why choose new zealand for higher education?' =>
'New Zealand offers globally recognized qualifications, high-quality education, a safe environment, and post-study work opportunities.',
'what is the process to apply to study in new zealand?' =>
'We guide students through selecting a course, checking eligibility, gathering documents, applying for a visa, and preparing for departure.',
'are there work opportunities in new zealand for students?' =>
'Yes, students can work part-time during study, full-time during holidays, and apply for post-study work visas after graduation.',
'what accommodation options are available in new zealand?' =>
'Students can choose from shared flats, homestays, hostels, or on-campus housing. We help you find the right option.',
'do you support nepalese students in new zealand?' =>
'Absolutely! We provide full pre-departure briefings and continuous support to ensure students feel at home in New Zealand.',
'rohini' =>
'Rohini International Education Services is a Nepal-based consultancy located in Kathmandu, specializing in guiding students who want to study in New Zealand. Visit https://rohini.edu.np/ for full information.',
'location' =>
'Our main office is at ' . $address . '. We also have branches in Birtamode, Birgunj, Damak, Chitwan, and Pokhara.',
'contact' =>
'You can call us at ' . $phone . ', email us at ' . $email .
', or message us on WhatsApp at ' . $whatsapp . '. Were available Sunday to Friday, 09:00 AM to 05:00 PM.',
'services' =>
'We provide counseling, university and course selection, visa application support, documentation help, pre-departure briefings, financial and scholarship guidance, and accommodation support for students going to New Zealand.',
'social media' =>
'Follow us on Instagram: ' . $instagram . ', YouTube: ' . $youtube . ', TikTok: ' . $tiktok . '.',
];
if (array_key_exists($userMessage, $allowedPrompts)) {
return response()->json([
'reply' => $allowedPrompts[$userMessage] . $contactInfo
]);
}
if (str_contains($userMessage, 'location') || str_contains($userMessage, 'located')) {
return response()->json([
'reply' => $allowedPrompts['where is rohini international located?'] . $contactInfo
]);
}
if (str_contains($userMessage, 'contact') || str_contains($userMessage, 'support')) {
return response()->json([
'reply' => $allowedPrompts['how can i contact support?'] . $contactInfo
]);
}
if (str_contains($userMessage, 'service') || str_contains($userMessage, 'services')) {
return response()->json([
'reply' => $allowedPrompts['what services do you provide?'] . $contactInfo
]);
}
foreach ($allowedPrompts as $prompt => $answer) {
similar_text($userMessage, $prompt, $percent);
if ($percent > 80) {
return response()->json([
'reply' => "Did you mean: \"$prompt\"?\n" . $answer . $contactInfo
]);
}
}
try {
$response = Http::timeout(60)
->retry(2, 100)
->withToken(config('services.openrouter.key'))
->post('https://openrouter.ai/api/v1/chat/completions', [
'model' => 'deepseek/deepseek-r1:free',
'messages' => [
[
'role' => 'system',
'content' => 'You are an assistant for Rohini International Education Services in Nepal. Answer ONLY using information found on https://rohini.edu.np/. If the question is not related to this organization or its services for studying in New Zealand, reply with: "Sorry, I can only answer questions related to Rohini International Education Services and studying in New Zealand."'
],
['role' => 'user', 'content' => $request->message],
],
]);
$response->throw();
return response()->json([
'reply' => ($response->json('choices.0.message.content') ?? 'No response from assistant.') . $contactInfo
]);
} catch (ConnectionException $e) {
return response()->json([
'reply' => 'Sorry, I could not connect to the AI service. Please try again later.' . $contactInfo
], 504);
} catch (RequestException $e) {
$msg = $e->response->json('error.message') ?? $e->getMessage();
return response()->json([
'reply' => 'Sorry, an error occurred. Please try again later.' . $contactInfo,
'error' => $msg
], 500);
}
}
}

View File

View File

@@ -0,0 +1,135 @@
<?php
namespace Modules\Chatbot\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Nwidart\Modules\Traits\PathNamespace;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
class ChatbotServiceProvider extends ServiceProvider
{
use PathNamespace;
protected string $name = 'Chatbot';
protected string $nameLower = 'chatbot';
/**
* Boot the application events.
*/
public function boot(): void
{
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->name, 'database/migrations'));
}
/**
* Register the service provider.
*/
public function register(): void
{
$this->app->register(EventServiceProvider::class);
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
// $this->commands([]);
}
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}
/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->nameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->nameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->name, 'lang'), $this->nameLower);
$this->loadJsonTranslationsFrom(module_path($this->name, 'lang'));
}
}
/**
* Register config.
*/
protected function registerConfig(): void
{
$relativeConfigPath = config('modules.paths.generator.config.path');
$configPath = module_path($this->name, $relativeConfigPath);
if (is_dir($configPath)) {
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($configPath));
foreach ($iterator as $file) {
if ($file->isFile() && $file->getExtension() === 'php') {
$relativePath = str_replace($configPath . DIRECTORY_SEPARATOR, '', $file->getPathname());
$configKey = $this->nameLower . '.' . str_replace([DIRECTORY_SEPARATOR, '.php'], ['.', ''], $relativePath);
$key = ($relativePath === 'config.php') ? $this->nameLower : $configKey;
$this->publishes([$file->getPathname() => config_path($relativePath)], 'config');
$this->mergeConfigFrom($file->getPathname(), $key);
}
}
}
}
/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->nameLower);
$sourcePath = module_path($this->name, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->nameLower.'-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->nameLower);
$componentNamespace = $this->module_namespace($this->name, $this->app_path(config('modules.paths.generator.component-class.path')));
Blade::componentNamespace($componentNamespace, $this->nameLower);
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->nameLower)) {
$paths[] = $path.'/modules/'.$this->nameLower;
}
}
return $paths;
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace Modules\Chatbot\Providers;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event handler mappings for the application.
*
* @var array<string, array<int, string>>
*/
protected $listen = [];
/**
* Indicates if events should be discovered.
*
* @var bool
*/
protected static $shouldDiscoverEvents = true;
/**
* Configure the proper event listeners for email verification.
*/
protected function configureEmailVerification(): void
{
//
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace Modules\Chatbot\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
protected string $name = 'Chatbot';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{
parent::boot();
}
/**
* Define the routes for the application.
*/
public function map(): void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
}
}

View File

View File

@@ -0,0 +1,30 @@
{
"name": "nwidart/chatbot",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Chatbot\\": "app/",
"Modules\\Chatbot\\Database\\Factories\\": "database/factories/",
"Modules\\Chatbot\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\Chatbot\\Tests\\": "tests/"
}
}
}

View File

View File

@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Chatbot',
];

View File

@@ -0,0 +1,16 @@
<?php
namespace Modules\Chatbot\Database\Seeders;
use Illuminate\Database\Seeder;
class ChatbotDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}

View File

@@ -0,0 +1,11 @@
{
"name": "Chatbot",
"alias": "chatbot",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Chatbot\\Providers\\ChatbotServiceProvider"
],
"files": []
}

View File

@@ -0,0 +1,15 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5",
"postcss": "^8.3.7",
"vite": "^4.0.0"
}
}

18
Modules/Chatbot/readme.md Normal file
View File

@@ -0,0 +1,18 @@
inside config/services.php
add
'openrouter' => [
'api_key' => env('OPENROUTER_API_KEY'),
'base_url' => 'https://openrouter.ai/api/v1/chat/completions',
],
----------------OR--------------------------
'openrouter' => [
'key' => env('OPENROUTER_API_KEY'),
],
-------------------------------
add to your .env
OPENROUTER_API_KEY=your_api_key

View File

@@ -0,0 +1,120 @@
/* Message Styling */
.message {
padding: 8px;
margin: 5px 0;
border-radius: 10px;
max-width: 100%;
word-wrap: break-word;
}
/* User Message (Blue with transparency) */
.user-message {
background-color: rgba(0, 123, 255, 0.2); /* Blue with 70% opacity */
color: black;
text-align: right;
align-self: flex-end;
}
/* Bot Message (vz-primary with transparency) */
.bot-message {
background-color: rgba(var(--vz-primary-rgb), 0.2); /* Assuming var(--vz-primary-rgb) holds RGB value */
color: black;
text-align: left;
align-self: flex-start;
}
/* Floating Chatbot Button */
#chatbot-toggle {
position: fixed;
bottom: 45px;
right: 38px;
width: 60px;
height: 60px;
background-color: var(--vz-primary); /* Using CSS variable */
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease-in-out;
z-index: 1000; /* Ensure it's above other elements */
}
/* Chatbot Container */
#chatbot-container {
position: fixed;
bottom: 42px;
right: 32px;
width: 320px;
background: white;
border: 1px solid #ccc;
border-radius: 10px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
font-family: Arial, sans-serif;
display: none;
flex-direction: column;
overflow: hidden;
z-index: 1000; /* Ensure it floats above the content */
}
/* Chatbot Header */
#chatbot-header {
background-color: var(--vz-primary);
color: white;
padding: 10px;
text-align: center;
font-size: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}
/* Close Button */
#chatbot-close {
font-size: 20px;
cursor: pointer;
}
/* Chatbot Body */
#chatbot-body {
height: 250px;
overflow-y: auto;
padding: 10px;
}
/* Input and Send Button Styling */
#chatbot-input-container {
position: relative;
display: flex;
align-items: center;
width: 100%;
margin-top: 10px;
padding: 5px;
}
#chatbot-input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 20px;
outline: none;
font-size: 14px;
box-sizing: border-box;
}
#chatbot-send {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
background-color: transparent;
border: none;
color: var(--vz-primary);
font-size: 18px;
cursor: pointer;
z-index: 10;
}

View File

@@ -0,0 +1,47 @@
$(document).ready(function() {
// Toggle chatbot visibility
$('#chatbot-toggle').click(function() {
$('#chatbot-container').fadeIn();
$('#chatbot-toggle').hide();
});
// Close chatbot
$('#chatbot-close').click(function() {
$('#chatbot-container').fadeOut();
$('#chatbot-toggle').show();
});
// Send message on button click
$('#chatbot-send').click(function() {
sendMessage();
});
// Send message on "Enter" key
$('#chatbot-input').keypress(function(e) {
if (e.which == 13) {
sendMessage();
}
});
function sendMessage() {
var message = $('#chatbot-input').val().trim();
if (message === '') return;
$('#chatbot-body').append('<div class="message user-message"><strong>You:</strong> ' + message + '</div>');
$('#chatbot-input').val('');
$('#chatbot-body').scrollTop($('#chatbot-body')[0].scrollHeight);
$.ajax({
url: '{{ route('chatbot.query') }}',
type: 'POST',
data: { message: message, _token: '{{ csrf_token() }}' },
success: function(response) {
$('#chatbot-body').append('<div class="message bot-message"><strong>Bot:</strong> ' + response.reply + '</div>');
$('#chatbot-body').scrollTop($('#chatbot-body')[0].scrollHeight);
},
error: function() {
$('#chatbot-body').append('<div class="message bot-message"><strong>Bot:</strong> Sorry, something went wrong.</div>');
}
});
}
});

View File

View File

@@ -0,0 +1,445 @@
@push('css')
<style>
/* Message Styling */
.message {
padding: 8px;
margin: 5px 0;
border-radius: 10px;
max-width: 100%;
word-wrap: break-word;
}
/* User Message (Blue with transparency) */
.user-message {
background-color: rgba(0, 123, 255, 0.2);
/* Blue with 70% opacity */
color: black;
text-align: right;
align-self: flex-end;
}
/* Bot Message (vz-primary with transparency) */
.bot-message {
background-color: rgba(var(--vz-primary-rgb), 0.2);
/* Assuming var(--vz-primary-rgb) holds RGB value */
color: black;
text-align: left;
align-self: flex-start;
}
/* Floating Chatbot Button */
#chatbot-toggle {
position: fixed;
bottom: 45px;
right: 38px;
width: 60px;
height: 60px;
background-color: var(--vz-primary);
/* Using CSS variable */
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease-in-out;
z-index: 1000;
/* Ensure it's above other elements */
}
/* Chatbot Container */
#chatbot-container {
position: fixed;
bottom: 42px;
right: 36px;
width: 320px;
padding: 0px;
background: white;
border: 1px solid #ccc;
border-radius: 10px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
font-family: Arial, sans-serif;
display: none;
flex-direction: column;
overflow: hidden;
z-index: 1000;
/* Ensure it floats above the content */
}
/* Chatbot Header */
#chatbot-header {
background-color: var(--vz-primary);
color: white;
padding: 10px;
text-align: center;
font-size: 16px;
display: flex;
justify-content: space-between;
align-items: center;
}
/* Close Button */
#chatbot-close {
font-size: 20px;
cursor: pointer;
}
/* Chatbot Body */
#chatbot-body {
height: 250px;
overflow-y: auto;
padding: 10px;
}
/* Input and Send Button Styling */
#chatbot-input-container {
position: relative;
display: flex;
align-items: center;
width: 100%;
margin-top: 10px;
padding: 5px;
}
#chatbot-input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 20px;
outline: none;
font-size: 14px;
box-sizing: border-box;
}
#chatbot-send {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
background-color: transparent;
border: none;
color: var(--vz-primary);
font-size: 18px;
cursor: pointer;
z-index: 10;
}
</style>
@endpush
<style>
/* floating buttons container */
.floating-social {
position: fixed;
bottom: 210px;
right: 45px;
display: flex;
flex-direction: column;
gap: 16px;
z-index: 9999;
}
/* each circular button */
.floating-social .btn-circle {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
color: #fff;
/* white icon */
text-decoration: none;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
/* brand backgrounds */
.btn-whatsapp {
background: #25D366;
}
.btn-facebook {
background: #1877F2;
}
</style>
<style>
.glowing-animation {
background-color: #F98D1E;
box-shadow: 0 0 10px rgba(249, 141, 30, 0.5),
0 0 20px rgba(249, 141, 30, 0.4),
0 0 30px rgba(249, 141, 30, 0.3);
animation: pulseGlow 2s ease-in-out infinite;
border-radius: 50%;
transition: transform 0.3s ease;
}
/* .glowing-animation:hover {
transform: scale(1.1);
} */
@keyframes pulseGlow {
0%,
100% {
box-shadow: 0 0 10px rgba(249, 141, 30, 0.4),
0 0 20px rgba(249, 141, 30, 0.3),
0 0 30px rgba(249, 141, 30, 0.2);
}
50% {
box-shadow: 0 0 20px rgba(249, 141, 30, 0.6),
0 0 30px rgba(249, 141, 30, 0.5),
0 0 40px rgba(249, 141, 30, 0.4);
}
}
</style>
<div class="floating-social">
<a href="https://{{ ltrim(setting('whatsapp'), 'https://') }}" target="_blank" class="btn-circle btn-whatsapp">
<i class="fab fa-whatsapp"></i>
</a>
<!-- Chatbot Floating Button -->
<div id="chatbot-toggle" class="glowing-animation">
<i class="ri-message-2-fill" style="font-size: 30px; color: white;"></i>
</div>
<!-- Chatbot UI -->
<div id="chatbot-container" style="z-index: 9999">
<div id="chatbot-header">
Chatbot
<span id="chatbot-close">&times;</span>
</div>
<div id="chatbot-body"></div>
<div id="chatbot-input-container">
<input type="text" id="chatbot-input" placeholder="Ask me something...">
<button id="chatbot-send">
<i class="ri-send-plane-2-fill"></i>
</button>
</div>
</div>
<!-- Styles -->
@push('css')
<style>
/* Floating Button */
#chatbot-toggle {
position: fixed;
bottom: 45px;
right: 38px;
width: 60px;
height: 60px;
background-color: var(--vz-primary);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
z-index: 1000;
}
/* Chat Container */
#chatbot-container {
position: fixed;
bottom: 42px;
right: 36px;
width: 340px;
height: 400px;
background: #fff;
border: 1px solid #ccc;
border-radius: 14px;
box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.25);
font-family: 'Segoe UI', sans-serif;
display: none;
flex-direction: column;
overflow: hidden;
z-index: 1000;
}
#chatbot-header {
background-color: var(--vz-primary);
color: white;
padding: 12px 16px;
font-size: 16px;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
}
#chatbot-body {
flex: 1;
padding: 12px;
overflow-y: auto;
background: #f9f9f9;
display: flex;
flex-direction: column;
scroll-behavior: smooth;
}
.message {
position: relative;
padding: 10px 16px;
margin: 6px 0;
border-radius: 20px;
max-width: 80%;
font-size: 14px;
line-height: 1.4;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.user-message {
background-color: rgba(0, 123, 255, 0.15);
color: black;
align-self: flex-end;
margin-left: auto;
border-bottom-right-radius: 0;
}
.bot-message {
background-color: rgba(var(--vz-primary-rgb), 0.15);
color: black;
align-self: flex-start;
margin-right: auto;
border-bottom-left-radius: 0;
}
.typing-indicator {
font-style: italic;
font-size: 13px;
color: #888;
margin-top: 5px;
margin-left: 5px;
}
#chatbot-input-container {
display: flex;
align-items: center;
padding: 10px;
border-top: 1px solid #eee;
background: #fff;
}
#chatbot-input {
flex: 1;
padding: 10px 15px;
border: 1px solid #ccc;
border-radius: 30px;
font-size: 14px;
outline: none;
margin-right: 8px;
}
#chatbot-send {
background: var(--vz-primary);
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 18px;
cursor: pointer;
}
.floating-social {
position: fixed;
bottom: 210px;
right: 45px;
display: flex;
flex-direction: column;
gap: 16px;
z-index: 9999;
}
.floating-social .btn-circle {
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
color: #fff;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
.btn-whatsapp {
background: #25D366;
}
</style>
@endpush
<!-- Scripts -->
@push('js')
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('#chatbot-toggle').click(function() {
$('#chatbot-container').fadeIn();
$(this).hide();
});
$('#chatbot-close').click(function() {
$('#chatbot-container').fadeOut();
$('#chatbot-toggle').show();
});
$('#chatbot-send').click(sendMessage);
$('#chatbot-input').keypress(function(e) {
if (e.which == 13) sendMessage();
});
function sendMessage() {
const input = $('#chatbot-input');
const body = $('#chatbot-body');
const message = input.val().trim();
if (message === '') return;
body.append('<div class="message user-message">You: ' + message + '</div>');
input.val('');
body.append('<div class="typing-indicator" id="typing">Bot is typing...</div>');
scrollToBottom();
$.ajax({
url: '{{ route('chatbot.query') }}',
type: 'POST',
data: {
message: message,
_token: '{{ csrf_token() }}'
},
success: function(response) {
$('#typing').remove();
body.append('<div class="message bot-message">Bot: ' + response.reply +
'</div>');
scrollToBottom();
},
error: function() {
$('#typing').remove();
body.append(
'<div class="message bot-message">Bot: Sorry, something went wrong.</div>'
);
scrollToBottom();
}
});
}
function scrollToBottom() {
const body = $('#chatbot-body');
body.scrollTop(body[0].scrollHeight);
}
});
</script>
@endpush

View File

@@ -0,0 +1,7 @@
@extends('chatbot::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>Module: {!! config('chatbot.name') !!}</p>
@endsection

View File

@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Chatbot Module - {{ config('app.name', 'Laravel') }}</title>
<meta name="description" content="{{ $description ?? '' }}">
<meta name="keywords" content="{{ $keywords ?? '' }}">
<meta name="author" content="{{ $author ?? '' }}">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
{{-- Vite CSS --}}
{{-- {{ module_vite('build-chatbot', 'resources/assets/sass/app.scss', storage_path('vite.hot')) }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-chatbot', 'resources/assets/js/app.js', storage_path('vite.hot')) }} --}}
</body>

View File

View File

@@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Chatbot\Http\Controllers\ChatbotController;
/*
*--------------------------------------------------------------------------
* API Routes
*--------------------------------------------------------------------------
*
* Here is where you can register API routes for your application. These
* routes are loaded by the RouteServiceProvider within a group which
* is assigned the "api" middleware group. Enjoy building your API!
*
*/
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
Route::apiResource('chatbot', ChatbotController::class)->names('chatbot');
});

View File

@@ -0,0 +1,21 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Chatbot\Http\Controllers\ChatbotController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::group([], function () {
Route::post('/chatbot/query', [ChatbotController::class, 'query'])->name('chatbot.query');
Route::resource('chatbot', ChatbotController::class)->names('chatbot');
});

View File

@@ -0,0 +1,57 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import { readdirSync, statSync } from 'fs';
import { join,relative,dirname } from 'path';
import { fileURLToPath } from 'url';
export default defineConfig({
build: {
outDir: '../../public/build-chatbot',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-chatbot',
input: [
__dirname + '/resources/assets/sass/app.scss',
__dirname + '/resources/assets/js/app.js'
],
refresh: true,
}),
],
});
// Scen all resources for assets file. Return array
//function getFilePaths(dir) {
// const filePaths = [];
//
// function walkDirectory(currentPath) {
// const files = readdirSync(currentPath);
// for (const file of files) {
// const filePath = join(currentPath, file);
// const stats = statSync(filePath);
// if (stats.isFile() && !file.startsWith('.')) {
// const relativePath = 'Modules/Chatbot/'+relative(__dirname, filePath);
// filePaths.push(relativePath);
// } else if (stats.isDirectory()) {
// walkDirectory(filePath);
// }
// }
// }
//
// walkDirectory(dir);
// return filePaths;
//}
//const __filename = fileURLToPath(import.meta.url);
//const __dirname = dirname(__filename);
//const assetsDir = join(__dirname, 'resources/assets');
//export const paths = getFilePaths(assetsDir);
//export const paths = [
// 'Modules/Chatbot/resources/assets/sass/app.scss',
// 'Modules/Chatbot/resources/assets/js/app.js',
//];

View File

@@ -14,10 +14,9 @@ class CostCalculatorService
$query->where('country_id', $request->country_id); $query->where('country_id', $request->country_id);
} }
if ($request->filled('stay_type_id')) { // if ($request->filled('stay_type_id')) {
$query->where("stay_type_id", $request->stay_type_id); // $query->where("stay_type_id", $request->stay_type_id);
} // }
})->latest()->paginate(10)->withQueryString(); })->latest()->paginate(10)->withQueryString();
} }

View File

@@ -3,6 +3,7 @@
namespace Modules\Document\Http\Controllers; namespace Modules\Document\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Modules\CCMS\Models\Country; use Modules\CCMS\Models\Country;
@@ -13,6 +14,7 @@ use Modules\Document\Services\DocumentService;
use Yajra\DataTables\Facades\DataTables; use Yajra\DataTables\Facades\DataTables;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\DB;
class DocumentController extends Controller class DocumentController extends Controller
@@ -26,14 +28,66 @@ class DocumentController extends Controller
public function index() public function index()
{ {
$title = 'Upload Documents'; $title = "Upload Document";
$countryOptions = Country::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Country:$id" => "Country - $title"]); $countryOptions = Country::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Country:$id" => "Country - $title"]);
$serviceOptions = Service::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Service:$id" => "Service - $title"]); $serviceOptions = Service::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Service:$id" => "Service - $title"]);
$testOptions = Test::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Test:$id" => "Test - $title"]); $testOptions = Test::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Test:$id" => "Test - $title"]);
$modelOptions = $countryOptions->merge($serviceOptions)->merge($testOptions); $modelOptions = $countryOptions->merge($serviceOptions)->merge($testOptions);
return view('document::document.index', compact('modelOptions', 'title')); if (request()->ajax()) {
$model = Document::query()->latest();
return DataTables::eloquent($model)
->setRowClass('tableRow')
->addColumn('name', function (Document $document) {
$extension = $document->getExtension();
$assetUrl = $document->getUrl();
$html = $document->isImageFile()
? "<div class='flex-shrink-0'>
<div class='avatar-sm bg-light rounded p-1'>
<a href='{$assetUrl}' data-fancybox='gallery' data-caption='{$document->title}'>
<img src='{$assetUrl}' alt='' class='avatar-sm img-fluid d-block'>
</a>
</div>
</div>"
: "<div class='flex-shrink-0'>
<div class='avatar-sm'>
<a href='{$assetUrl}' data-fancybox='gallery' data-caption='{$document->title}'>
<div class='avatar-title bg-" . getFileIcon($extension)[1] . "-subtle text-" . getFileIcon($extension)[1] . " fs-20 material-shadow rounded'>
<i class='" . getFileIcon($extension)[0] . "'></i>
</div>
</a>
</div>
</div>";
return "<div class='d-flex align-items-center'>
{$html} <div class='flex-grow-1 ms-3'>
<h6 class='fs-12 mb-0'>{$document->title}</h6>
</div>
</div>";
})
->addColumn('type', function (Document $document) {
return $document->getExtension();
})
->addColumn('size', function (Document $document) {
return $document->getSize();
})
->editColumn('created_at', function (Document $document) {
return getFormatted($document->created_at);
})
->addColumn('action', function (Document $document) {
return view('document::document.partials.action', ['document' => $document]);
})
->rawColumns(['action', 'name', 'size'])
->toJson();
}
return view('document::document.index', [
'title' => $title,
'countryOptions' => $countryOptions,
'serviceOptions' => $serviceOptions,
'testOptions' => $testOptions,
'modelOptions' => $modelOptions,
]);
} }
@@ -48,7 +102,7 @@ class DocumentController extends Controller
$document->delete(); $document->delete();
session()->flash('Document Deleted'); session()->flash('Document Deleted');
return response()->json(['status' => true, 'msg' => 'Document Deleted']); return response()->json(['status' => 200, 'message' => 'Document Deleted Successfully']);
} catch (\Throwable $th) { } catch (\Throwable $th) {
session()->flash('error', $th->getMessage()); session()->flash('error', $th->getMessage());
} }
@@ -122,21 +176,27 @@ class DocumentController extends Controller
public function getAllDocuments() public function getAllDocuments()
{ {
$model = Document::query()->latest(); $countryOptions = Country::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Country:$id" => "Country - $title"]);
return DataTables::eloquent($model) $serviceOptions = Service::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Service:$id" => "Service - $title"]);
->setRowClass('tableRow') $testOptions = Test::whereNull('parent_id')->pluck('title', 'id')->mapWithKeys(fn($title, $id) => ["Test:$id" => "Test - $title"]);
->addColumn('name', function (Document $document) { $modelOptions = $countryOptions->merge($serviceOptions)->merge($testOptions);
$extension = $document->getExtension();
$assetUrl = $document->getUrl(); if (request()->ajax()) {
$html = $document->isImageFile() $model = Document::query()->latest();
? "<div class='flex-shrink-0'> return DataTables::eloquent($model)
->setRowClass('tableRow')
->addColumn('name', function (Document $document) {
$extension = $document->getExtension();
$assetUrl = $document->getUrl();
$html = $document->isImageFile()
? "<div class='flex-shrink-0'>
<div class='avatar-sm bg-light rounded p-1'> <div class='avatar-sm bg-light rounded p-1'>
<a href='{$assetUrl}' data-fancybox='gallery' data-caption='{$document->title}'> <a href='{$assetUrl}' data-fancybox='gallery' data-caption='{$document->title}'>
<img src='{$assetUrl}' alt='' class='avatar-sm img-fluid d-block'> <img src='{$assetUrl}' alt='' class='avatar-sm img-fluid d-block'>
</a> </a>
</div> </div>
</div>" </div>"
: "<div class='flex-shrink-0'> : "<div class='flex-shrink-0'>
<div class='avatar-sm'> <div class='avatar-sm'>
<a href='{$assetUrl}' data-fancybox='gallery' data-caption='{$document->title}'> <a href='{$assetUrl}' data-fancybox='gallery' data-caption='{$document->title}'>
<div class='avatar-title bg-" . getFileIcon($extension)[1] . "-subtle text-" . getFileIcon($extension)[1] . " fs-20 material-shadow rounded'> <div class='avatar-title bg-" . getFileIcon($extension)[1] . "-subtle text-" . getFileIcon($extension)[1] . " fs-20 material-shadow rounded'>
@@ -146,40 +206,47 @@ class DocumentController extends Controller
</div> </div>
</div>"; </div>";
return "<div class='d-flex align-items-center'> return "<div class='d-flex align-items-center'>
{$html} <div class='flex-grow-1 ms-3'> {$html} <div class='flex-grow-1 ms-3'>
<h6 class='fs-12 mb-0'>{$document->title}</h6> <h6 class='fs-12 mb-0'>{$document->title}</h6>
</div> </div>
</div>"; </div>";
}) })
->addColumn('type', function (Document $document) { ->addColumn('type', function (Document $document) {
return $document->getExtension(); return $document->getExtension();
}) })
->addColumn('size', function (Document $document) { ->addColumn('size', function (Document $document) {
return $document->getSize(); return $document->getSize();
}) })
->editColumn('created_at', function (Document $document) { ->editColumn('created_at', function (Document $document) {
return getFormatted($document->created_at); return getFormatted($document->created_at);
}) })
->addColumn('action', function (Document $document) { ->addColumn('action', function (Document $document) {
return view('document::document.partials.action', ['document' => $document]); return view('document::document.partials.action', ['document' => $document]);
}) })
->rawColumns(['action', 'name', 'size']) ->rawColumns(['action', 'name', 'size'])
->toJson(); ->toJson();
}
return view('document::document.index', [
'countryOptions' => $countryOptions,
'serviceOptions' => $serviceOptions,
'testOptions' => $testOptions,
'modelOptions' => $modelOptions,
]);
} }
public function reorder(Request $request) public function reorder(Request $request)
{ {
Document::chunkById(100, function (Collection $documents) use ($request) { $partners = Document::all();
foreach ($documents as $document) {
foreach ($request->order as $order) { foreach ($partners as $partner) {
if ($order['id'] == $document->id) { foreach ($request->order as $order) {
$document->update(['order' => $order['position']]); if ($order['id'] == $partner->id) {
} $partner->update(['order' => $order['position']]);
} }
} }
}); }
return response(['status' => true, 'message' => 'Reordered successfully'], 200); return response(['status' => true, 'message' => 'Reordered successfully'], 200);
} }
} }

View File

@@ -32,7 +32,7 @@
]; ];
@endphp @endphp
<x-data-table-script :route="route('documents.getAllDocuments')" :columns="$columns" id="documents-table" :reorder="route('documents.reorder')" /> <x-data-table-script :route="route('documents.index')" :columns="$columns" :reorder="route('documents.reorder')" />
</div> </div>
</div> </div>

View File

@@ -1,7 +1,5 @@
<div class="hstack flex-wrap gap-3 align-items-center"> <div class="hstack flex-wrap gap-3 align-items-center">
<a href="{{ $document->getUrl() }}" class="link-primary fs-15" download><i class="ri-download-2-line"></i></a> <a href="{{ $document->getUrl() }}" class="link-primary fs-15" download><i class="ri-download-2-line"></i></a>
@can('documents.destroy') <a href="javascript:void(0);" data-link="{{ route('documents.destroy', $document->id) }}"
<a href="javascript:void(0);" data-link="{{ route('documents.destroy', $document->id) }}" class="link-danger fs-15 remove-item"><i class="ri-delete-bin-line"></i></a>
class="link-danger fs-15 remove-item"><i class="ri-delete-bin-line"></i></a>
@endcan
</div> </div>

View File

@@ -16,10 +16,9 @@ use Modules\Meeting\Http\Controllers\MeetingController;
*/ */
Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/'], function () { Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/'], function () {
Route::resource('event', EventController::class)->names('event'); // Route::resource('event', EventController::class)->names('event');
Route::post('meeting/sub-task', [MeetingController::class, 'storeSubTask'])->name('meeting.storeSubTask'); Route::post('meeting/sub-task', [MeetingController::class, 'storeSubTask'])->name('meeting.storeSubTask');
Route::resource('meeting', MeetingController::class)->names('meeting'); Route::resource('meeting', MeetingController::class)->names('meeting');
Route::get('meeting/{id}/send-email', [MeetingController::class, 'sendEmail'])->name('meeting.sendmail'); Route::get('meeting/{id}/send-email', [MeetingController::class, 'sendEmail'])->name('meeting.sendmail');
}); });

View File

@@ -29,7 +29,7 @@ class UserService
'name' => $userData['name'], 'name' => $userData['name'],
'email' => $userData['email'], 'email' => $userData['email'],
'password' => Hash::make($userData['password'] ?? "password"), 'password' => Hash::make($userData['password'] ?? "password"),
'can_login' => $userData['can_login'] ?? false, 'can_login' => $userData['can_login'] ?? true,
'order' => $userData['order'], 'order' => $userData['order'],
]); ]);

View File

@@ -3,6 +3,10 @@
use App\Http\Controllers\WebsiteController; use App\Http\Controllers\WebsiteController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Modules\CCMS\Http\Controllers\EnquiryController; use Modules\CCMS\Http\Controllers\EnquiryController;
use Modules\CCMS\Http\Controllers\FranchiseController;
use Modules\CCMS\Http\Controllers\NewsletterController;
use Modules\CCMS\Http\Controllers\VacancyController;
use Modules\CCMS\Models\Franchise;
use Modules\CourseFinder\Http\Controllers\CoopController; use Modules\CourseFinder\Http\Controllers\CoopController;
use Modules\CourseFinder\Http\Controllers\ProgramController; use Modules\CourseFinder\Http\Controllers\ProgramController;
use Modules\CourseFinder\Http\Controllers\ProgramLevelController; use Modules\CourseFinder\Http\Controllers\ProgramLevelController;
@@ -19,6 +23,12 @@ Route::get('destination/{alias}', [WebsiteController::class, 'countrySingle'])->
Route::get('/home/resources', [WebsiteController::class, 'resources']); Route::get('/home/resources', [WebsiteController::class, 'resources']);
Route::get('getCoursesList', [ProgramController::class, 'getCoursesList'])->name('program.getCoursesList'); Route::get('getCoursesList', [ProgramController::class, 'getCoursesList'])->name('program.getCoursesList');
Route::post('enquiry', [EnquiryController::class, 'store'])->name('enquiry.store'); Route::post('enquiry', [EnquiryController::class, 'store'])->name('enquiry.store');
Route::post('franchise', [FranchiseController::class, 'store'])->name('franchise.store');
Route::post('newsletter', [NewsletterController::class, 'store'])->name('newsletter.store');
Route::post('vacancy', [VacancyController::class, 'store'])->name('vacancy.store');
Route::get('career/{id}', [WebsiteController::class, 'careerSingle'])->name('career.single');
Route::get('getCost', [WebsiteController::class, 'getCost'])->name('cost.getCost'); Route::get('getCost', [WebsiteController::class, 'getCost'])->name('cost.getCost');
Route::get('/thankyou', [WebsiteController::class, 'thankyouPage'])->name('thankyou'); Route::get('/thankyou', [WebsiteController::class, 'thankyouPage'])->name('thankyou');

View File

@@ -1,9 +1,11 @@
<?php <?php
use Modules\CCMS\Models\Blog; use Modules\CCMS\Models\Blog;
use Modules\CCMS\Models\Career;
use Modules\CCMS\Models\Category; use Modules\CCMS\Models\Category;
use Modules\CCMS\Models\Counter; use Modules\CCMS\Models\Counter;
use Modules\CCMS\Models\Country; use Modules\CCMS\Models\Country;
use Modules\CCMS\Models\Event;
use Modules\CCMS\Models\Faq; use Modules\CCMS\Models\Faq;
use Modules\CCMS\Models\FaqCategory; use Modules\CCMS\Models\FaqCategory;
use Modules\CCMS\Models\Gallery; use Modules\CCMS\Models\Gallery;
@@ -150,6 +152,44 @@ function getServices($limit = null, $order = 'desc')
->get(); ->get();
} }
function getCareers($limit = null, $order = 'desc')
{
return Career::query()
->where('status', 1)
->orderBy('order', $order)
->when($limit, function ($query) use ($limit) {
$query->limit($limit);
})
->get();
}
function previousEvents($limit = null, $order = 'desc')
{
return Event::query()
->where('status', 1)
->where('parent_id', null)
->where('start_date', '<=', now())
->orderBy('order', $order)
->when($limit, function ($query) use ($limit) {
$query->limit($limit);
})
->get();
}
function upcomingEvents($limit = null, $order = 'desc')
{
return Event::query()
->where('status', 1)
->where('parent_id', null)
->where('start_date', '>=', now())
->orderBy('order', $order)
->when($limit, function ($query) use ($limit) {
$query->limit($limit);
})
->get();
}
function getInstitutions($limit = null, $order = 'desc') function getInstitutions($limit = null, $order = 'desc')
{ {
return Institution::query() return Institution::query()

View File

@@ -6,6 +6,7 @@ use App\Models\User;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
use Modules\CCMS\Models\Blog; use Modules\CCMS\Models\Blog;
use Modules\CCMS\Models\Enquiry; use Modules\CCMS\Models\Enquiry;
use Modules\CCMS\Models\Event;
use Modules\CCMS\Models\Partner; use Modules\CCMS\Models\Partner;
use Modules\CCMS\Models\Service; use Modules\CCMS\Models\Service;
use Modules\CCMS\Models\Team; use Modules\CCMS\Models\Team;
@@ -21,6 +22,7 @@ class DashboardController extends Controller
'teamsCount' => Team::where('status', 1)->count(), 'teamsCount' => Team::where('status', 1)->count(),
'servicesCount' => Service::where('status', 1)->count(), 'servicesCount' => Service::where('status', 1)->count(),
'partnersCount' => Partner::where('status', 1)->count(), 'partnersCount' => Partner::where('status', 1)->count(),
'events' => Event::where('start_date', '>=', now())->limit(2)->get(),
]); ]);
} }
@@ -30,9 +32,6 @@ class DashboardController extends Controller
$model = Enquiry::query()->where('is_read', 0)->latest(); $model = Enquiry::query()->where('is_read', 0)->latest();
return DataTables::eloquent($model) return DataTables::eloquent($model)
->addIndexColumn() ->addIndexColumn()
->editColumn('class', function (Enquiry $enquiry) {
return $enquiry->class ?? '-';
})
->editColumn('subject', function (Enquiry $enquiry) { ->editColumn('subject', function (Enquiry $enquiry) {
return $enquiry->subject ?? '-'; return $enquiry->subject ?? '-';
}) })

View File

@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\View;
use Modules\CCMS\Models\Blog; use Modules\CCMS\Models\Blog;
use Modules\CCMS\Models\Career;
use Modules\CCMS\Models\Country; use Modules\CCMS\Models\Country;
use Modules\CCMS\Models\Institution; use Modules\CCMS\Models\Institution;
use Modules\CCMS\Models\Page; use Modules\CCMS\Models\Page;
@@ -17,6 +18,7 @@ use Modules\CourseFinder\Models\Coop;
use Modules\CourseFinder\Models\Program; use Modules\CourseFinder\Models\Program;
use Modules\CourseFinder\Models\ProgramLevel; use Modules\CourseFinder\Models\ProgramLevel;
use Modules\CourseFinder\Services\ProgramService; use Modules\CourseFinder\Services\ProgramService;
use Illuminate\Support\Str;
class WebsiteController extends Controller class WebsiteController extends Controller
{ {
@@ -33,6 +35,8 @@ class WebsiteController extends Controller
$countries = Country::where('status', 1)->where('parent_id', null)->get(); $countries = Country::where('status', 1)->where('parent_id', null)->get();
$interviews = Service::where('status', 1)->where('parent_id', null)->get(); $interviews = Service::where('status', 1)->where('parent_id', null)->get();
$services = Service::where('status', 1)->where('parent_id', null)->get(); $services = Service::where('status', 1)->where('parent_id', null)->get();
$data['previousEvents'] = previousEvents(limit: null, order: 'asc');
$data['upcomingEvents'] = upcomingEvents(limit: null, order: 'asc');
$this->path = config('app.client'); $this->path = config('app.client');
view()->share([ view()->share([
@@ -42,6 +46,8 @@ class WebsiteController extends Controller
'countries' => $countries, 'countries' => $countries,
'services' => $services, 'services' => $services,
'interviews' => $interviews, 'interviews' => $interviews,
'previousEvents' => $data['previousEvents'],
'upcomingEvents' => $data['upcomingEvents'],
]); ]);
} }
@@ -57,7 +63,7 @@ class WebsiteController extends Controller
$data['faqs'] = getFAQs(limit: null, order: 'desc'); $data['faqs'] = getFAQs(limit: null, order: 'desc');
$data['testimonials'] = getTestimonials(limit: null, order: 'desc'); $data['testimonials'] = getTestimonials(limit: null, order: 'desc');
$data['blogs'] = getBlogs(limit: 4, order: 'desc'); $data['blogs'] = getBlogs(limit: 4, order: 'desc');
$data['partners'] = getPartners(limit: 4, order: 'desc'); $data['partners'] = getPartners();
$data['gallaries'] = getGalleries(limit: 6, order: 'asc'); $data['gallaries'] = getGalleries(limit: 6, order: 'asc');
$data['achievementGalleries'] = getGalleriesByCategory(limit: null, order: 'asc', category: 'achievement'); $data['achievementGalleries'] = getGalleriesByCategory(limit: null, order: 'asc', category: 'achievement');
$data['visaGalleries'] = getGalleriesByCategory(limit: null, order: 'asc', category: 'visa-success'); $data['visaGalleries'] = getGalleriesByCategory(limit: null, order: 'asc', category: 'visa-success');
@@ -126,6 +132,13 @@ class WebsiteController extends Controller
} }
public function careerSingle($id)
{
$data['career'] = Career::findorFail($id);
return view("client.$this->path.pages.career-detail-template", $data);
}
public function testSingle($alias) public function testSingle($alias)
{ {
$testPreparations = $data["page"] = Test::where('status', 1) $testPreparations = $data["page"] = Test::where('status', 1)
@@ -176,7 +189,8 @@ class WebsiteController extends Controller
$page = getPageWithChildrenBySlug(parent: $parent, slug: $slug, limit: null, order: 'asc'); $page = getPageWithChildrenBySlug(parent: $parent, slug: $slug, limit: null, order: 'asc');
$teams = getTeams(limit: null, order: 'asc'); $teams = getTeams(limit: null, order: 'asc');
$blogs = getBlogs(limit: null, order: 'asc'); $blogs = getBlogs(limit: null, order: 'asc');
$galleriesCSR = getPageWithChildrenBySlug(parent: $parent, slug: 'gallery', limit: null, order: 'asc');
$careers = getCareers(limit: null, order: 'asc');
if (!$page) { if (!$page) {
return view('client.raffles.errors.404'); return view('client.raffles.errors.404');
} }
@@ -187,7 +201,7 @@ class WebsiteController extends Controller
return view('client.raffles.errors.404'); return view('client.raffles.errors.404');
} }
return view($path, ['page' => $page, 'teams' => $teams, 'blogs' => $blogs]); return view($path, ['page' => $page, 'teams' => $teams, 'blogs' => $blogs, 'galleriesCSR' => $galleriesCSR], ['careers' => $careers]);
} }
public function fallback() public function fallback()
@@ -259,61 +273,80 @@ class WebsiteController extends Controller
public function getCost(Request $request) public function getCost(Request $request)
{ {
$data['costss'] = $this->costCalculatorService->findAll($request); $costs = $this->costCalculatorService->findAll($request);
foreach ($data['costss'] as $value) {
$id = $value->id; if ($costs->isEmpty()) {
return view("client.raffles.errors.404");
} }
$id = $costs->last()->id;
$cost = CostCalculator::with([ $cost = CostCalculator::with([
'stayTypeLiving', 'stayTypeLiving',
'stayTypeAccomodation', 'stayTypeAccomodation',
'stayTypeOnetime', 'stayTypeOnetime',
'stayTypeService' 'stayTypeService'
])->findOrFail($id); ])->find($id);
$data['fee'] = Program::where('id', $request->program_id)->first();
$data['title'] = 'View Cost Calculation'; if (!$cost) {
$data['cost'] = $cost; return view("client.raffles.errors.404");
}
$program = Program::find($request->program_id);
if (!$program) {
return view("client.raffles.errors.404");
}
$getBreakdown = function ($stayTypeTitle) use ($cost) { $getBreakdown = function ($stayTypeTitle) use ($cost) {
$living = optional($cost->stayTypeLiving->firstWhere('title', $stayTypeTitle))->pivot; $living = optional($cost->stayTypeLiving->firstWhere('title', $stayTypeTitle))->pivot;
$accomodation = optional($cost->stayTypeAccomodation->firstWhere('title', $stayTypeTitle))->pivot; $accomodation = optional($cost->stayTypeAccomodation->firstWhere('title', $stayTypeTitle))->pivot;
$onetime = optional($cost->stayTypeOnetime->firstWhere('title', $stayTypeTitle))->pivot; $onetime = optional($cost->stayTypeOnetime->firstWhere('title', $stayTypeTitle))->pivot;
$service = optional($cost->stayTypeService->firstWhere('title', $stayTypeTitle))->pivot; $service = optional($cost->stayTypeService->firstWhere('title', $stayTypeTitle))->pivot;
return [ return [
'living' => [ 'living' => [
'monthly' => $living->monthly ?? 0, 'monthly' => $living->monthly ?? 0,
'yearly' => $living->yearly ?? 0, 'yearly' => $living->yearly ?? 0,
], ],
'accomodation' => [ 'accomodation' => [
'monthly' => $accomodation->monthly ?? 0, 'monthly' => $accomodation->monthly ?? 0,
'yearly' => $accomodation->yearly ?? 0, 'yearly' => $accomodation->yearly ?? 0,
], ],
'onetime' => [ 'onetime' => [
'visa' => $onetime->visa ?? 0, 'visa' => $onetime->visa ?? 0,
'biometrics' => $onetime->biometrics ?? 0, 'biometrics' => $onetime->biometrics ?? 0,
'sevis' => $onetime->sevis ?? 0, 'sevis' => $onetime->sevis ?? 0,
'application' => $onetime->application ?? 0, 'application' => $onetime->application ?? 0,
'total' => ($onetime->visa ?? 0) + ($onetime->biometrics ?? 0) + ($onetime->sevis ?? 0) + ($onetime->application ?? 0), 'total' => ($onetime->visa ?? 0) + ($onetime->biometrics ?? 0) + ($onetime->sevis ?? 0) + ($onetime->application ?? 0),
], ],
'service' => [ 'service' => [
'flight_ticket' => $service->flight_ticket ?? 0, 'flight_ticket' => $service->flight_ticket ?? 0,
'insurance' => $service->insurance ?? 0, 'insurance' => $service->insurance ?? 0,
'extra' => $service->extra ?? 0, 'extra' => $service->extra ?? 0,
'total' => ($service->flight_ticket ?? 0) + ($service->insurance ?? 0) + ($service->extra ?? 0), 'total' => ($service->flight_ticket ?? 0) + ($service->insurance ?? 0) + ($service->extra ?? 0),
] ]
]; ];
}; };
$data['breakdowns'] = [ $data = [
'alone' => $getBreakdown('Alone'), 'serviceStatus' => $request->services,
'with_spouse' => $getBreakdown('With Spouse'), 'costs' => $costs,
'with_spouse_and_child' => $getBreakdown('With Spouse and Child'), 'fee' => $program,
'title' => 'View Cost Calculation',
'cost' => $cost,
'type' => Str::slug($request->status_type_id),
'breakdowns' => [
'alone' => $getBreakdown('Alone'),
'with-spouse' => $getBreakdown('With Spouse'),
'with-spouse-and-child' => $getBreakdown('With Spouse and Child'),
],
]; ];
return view('client.raffles.pages.cost-result', $data); return view('client.raffles.pages.cost-result', $data);
} }
public function thankyouPage(Request $r) public function thankyouPage(Request $r)
{ {
$data = new \stdClass(); $data = new \stdClass();

View File

@@ -24,7 +24,7 @@ class AppServiceProvider extends ServiceProvider
*/ */
public function boot(): void public function boot(): void
{ {
Module::macro('sidebarMenu', function ($activeSidebar) { Module::macro('sidebarMenu', function ($activeSidebar) {
return view('components.dashboard.sidebar-menu', [ return view('components.dashboard.sidebar-menu', [
'menus' => config($activeSidebar), 'menus' => config($activeSidebar),
]); ]);

View File

@@ -125,7 +125,7 @@ return [
], ],
'sidebar' => [ 'sidebar' => [
'default' => env('DEFAULT_SIDEBAR', 'cpm-sidebar'), 'default' => env('DEFAULT_SIDEBAR', 'sidebar'),
'other' => env('OTHER_SIDEBAR', 'sidebar'), 'other' => env('OTHER_SIDEBAR', 'sidebar'),
], ],
]; ];

View File

@@ -3,12 +3,12 @@ return [
[ [
'text' => 'Dashboard', 'text' => 'Dashboard',
'url' => 'admin/dashboard', 'url' => 'admin/dashboard',
'icon' => 'ri-home-4-line', 'icon' => 'ri-home-fill text-primary',
], ],
[ [
'text' => 'Authorization', 'text' => 'Authorization',
'icon' => 'ri-user-settings-line', 'icon' => 'ri-user-settings-fill text-dark',
'module' => 'User', 'module' => 'User',
'submenu' => [ 'submenu' => [
[ [
@@ -32,7 +32,7 @@ return [
[ [
'text' => 'Setting', 'text' => 'Setting',
'url' => 'admin/setting', 'url' => 'admin/setting',
'icon' => 'ri-settings-4-line', 'icon' => 'ri-settings-2-fill text-danger',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['setting.index'], 'can' => ['setting.index'],
], ],
@@ -40,31 +40,61 @@ return [
[ [
'text' => 'Menu', 'text' => 'Menu',
'url' => 'admin/menu', 'url' => 'admin/menu',
'icon' => 'ri-menu-line', 'icon' => 'ri-menu-fill text-dark',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['menu.index'], 'can' => ['menu.index'],
], ],
[ [
'text' => 'Offer Popup', 'text' => 'Enquiries',
'url' => 'admin/popup', 'icon' => 'ri-cellphone-fill text-success',
'icon' => 'ri-gift-2-line',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['popup.index'], 'submenu' => [
[
'text' => 'Enquiry',
'url' => 'admin/enquiry',
'can' => ['enquiry.index'],
],
[
'text' => 'Counsellor Request',
'url' => 'admin/counselor',
'can' => ['counselor.index'],
],
[
'text' => 'Franchise Request',
'url' => 'admin/franchise',
'can' => ['franchise.index'],
],
[
'text' => 'Newsletter',
'url' => 'admin/newsletter',
'can' => ['newsletter.index'],
],
[
'text' => 'Vacancy Application',
'url' => 'admin/vacancy',
'can' => ['vacancy.index'],
],
],
], ],
[ [
'text' => 'Counter', 'text' => 'Counter',
'url' => 'admin/counter', 'url' => 'admin/counter',
'icon' => 'ri-add-circle-line', 'icon' => 'ri-add-circle-fill text-info',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['counter.index'], 'can' => ['counter.index'],
], ],
[ [
'text' => 'Page', 'text' => 'Pages',
'url' => 'admin/page', 'url' => 'admin/page',
'icon' => 'ri-pages-line', 'icon' => 'ri-pages-line text-dark',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['page.index'], 'can' => ['page.index'],
], ],
@@ -72,7 +102,7 @@ return [
[ [
'text' => 'Slider', 'text' => 'Slider',
'url' => 'admin/slider', 'url' => 'admin/slider',
'icon' => 'ri-slideshow-3-line', 'icon' => 'ri-slideshow-3-fill text-warning',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['slider.index'], 'can' => ['slider.index'],
], ],
@@ -80,7 +110,7 @@ return [
[ [
'text' => 'Testimonial', 'text' => 'Testimonial',
'url' => 'admin/testimonial', 'url' => 'admin/testimonial',
'icon' => 'ri-feedback-line', 'icon' => 'ri-feedback-fill text-success',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['testimonial.index'], 'can' => ['testimonial.index'],
], ],
@@ -88,7 +118,7 @@ return [
[ [
'text' => 'Partner', 'text' => 'Partner',
'url' => 'admin/partner', 'url' => 'admin/partner',
'icon' => 'ri-hand-heart-line', 'icon' => 'ri-hand-heart-fill text-danger',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['partner.index'], 'can' => ['partner.index'],
], ],
@@ -96,40 +126,46 @@ return [
[ [
'text' => 'Service', 'text' => 'Service',
'url' => 'admin/service', 'url' => 'admin/service',
'icon' => 'ri-customer-service-2-line', 'icon' => 'ri-customer-service-2-fill text-success',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['service.index'], 'can' => ['service.index'],
], ],
[
'text' => 'Events',
'url' => 'admin/event',
'icon' => 'ri-calendar-todo-fill text-primary',
'module' => 'CCMS',
'can' => ['event.index'],
],
[ [
'text' => 'Team', 'text' => 'Team',
'url' => 'admin/team', 'url' => 'admin/team',
'icon' => 'ri-team-line', 'icon' => 'ri-team-fill text-primary',
'module' => 'CCMS', 'module' => 'CCMS',
'can' => ['team.index'], 'can' => ['team.index'],
], ],
[ [
'text' => 'Blog', 'text' => 'Career',
'icon' => 'ri-newspaper-line', 'url' => 'admin/career',
'icon' => 'ri-suitcase-fill text-danger',
'module' => 'CCMS', 'module' => 'CCMS',
'submenu' => [ 'can' => ['career.index'],
[ ],
'url' => 'admin/category',
'text' => 'Blog Category', [
'can' => ['category.index'], 'text' => 'Blog',
], 'url' => 'admin/blog',
[ 'icon' => 'ri-newspaper-fill text-dark',
'url' => 'admin/blog', 'module' => 'CCMS',
'text' => 'Blog', 'can' => ['blog.index'],
'can' => ['blog.index'],
],
],
], ],
[ [
'text' => 'Study Abroad', 'text' => 'Study Abroad',
'icon' => 'ri-earth-line', 'icon' => 'ri-earth-fill text-success',
'module' => 'CCMS', 'module' => 'CCMS',
'submenu' => [ 'submenu' => [
[ [
@@ -147,7 +183,7 @@ return [
[ [
'text' => 'Testimonial Videos', 'text' => 'Testimonial Videos',
'icon' => ' ri-camera-line', 'icon' => ' ri-camera-fill text-dark',
'module' => 'CCMS', 'module' => 'CCMS',
'submenu' => [ 'submenu' => [
[ [
@@ -165,7 +201,7 @@ return [
[ [
'text' => 'FAQ', 'text' => 'FAQ',
'icon' => 'ri-questionnaire-line', 'icon' => 'ri-questionnaire-fill text-danger',
'module' => 'CCMS', 'module' => 'CCMS',
'submenu' => [ 'submenu' => [
[ [
@@ -181,25 +217,11 @@ return [
], ],
], ],
[
'text' => 'Enquiry',
'url' => 'admin/enquiry',
'icon' => ' ri-cellphone-line',
'module' => 'CCMS',
'can' => ['enquiry.index'],
],
[
'text' => 'Counsellor Request',
'url' => 'admin/counselor',
'icon' => ' ri-cellphone-line',
'module' => 'CCMS',
'can' => ['counselor.index'],
],
[ [
'text' => 'Course Finder', 'text' => 'Course Finder',
'icon' => 'ri-book-2-line', 'icon' => 'ri-book-2-fill text-primary',
'module' => 'CourseFinder', 'module' => 'CourseFinder',
'submenu' => [ 'submenu' => [
@@ -236,7 +258,7 @@ return [
[ [
'text' => 'Cost Calculator', 'text' => 'Cost Calculator',
'icon' => 'ri-newspaper-line', 'icon' => 'ri-calculator-line text-primary',
'module' => 'CostCalculator', 'module' => 'CostCalculator',
'submenu' => [ 'submenu' => [
[ [
@@ -255,15 +277,16 @@ return [
[ [
'text' => 'Free Resources', 'text' => 'Free Resources',
'url' => 'admin/documents', 'url' => 'admin/documents',
'icon' => 'ri-file-text-line', 'icon' => 'ri-file-upload-fill text-dark',
'module' => 'Document', 'module' => 'Document',
'can' => ['documents.index'], 'can' => ['documents.index'],
], ],
[ [
'text' => 'Resume Builder', 'text' => 'Template',
'url' => 'admin/resume', 'url' => 'admin/template',
'icon' => 'ri-pages-line', 'icon' => 'ri-mail-send-fill text-info',
'module' => 'CCMS', 'module' => 'Template',
'can' => ['resume.index'], 'can' => ['template.index'],
], ]
]; ];

View File

@@ -18,5 +18,6 @@
"Drive": true, "Drive": true,
"Sitemap": true, "Sitemap": true,
"Document": true, "Document": true,
"CostCalculator": true "CostCalculator": true,
"Chatbot": true
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,17 @@
.dropify-message p { a {
text-decoration: none !important;
}
.form-control {
background-color: #ffff;
}
.form-label {
font-size: 12px;
margin-bottom: 0px;
}
/* .dropify-message p {
font-size: 15px; font-size: 15px;
} }
@@ -7,147 +20,26 @@ legend {
all: revert; all: revert;
} }
.upload__box { .dropify-wrapper {
padding: 5px; height: 100px;
} }
.upload__btn-box {
margin-bottom: 10px; fieldset.scheduler-border {
border: 1px groove #ddd !important;
padding: 0 1.4em 1.4em 1.4em !important;
-webkit-box-shadow: 0px 0px 0px 0px #000;
box-shadow: 0px 0px 0px 0px #000;
} }
.upload__img-wrap { legend.scheduler-border {
display: flex; font-size: 1.2em !important;
flex-wrap: wrap; font-weight: semibold !important;
} text-align: left !important;
width: auto;
.upload__img-box { padding: 0 10px;
width: 125px; border-bottom: none;
margin-bottom: 12px; margin-top: -15px;
}
.upload__img-close {
width: 24px;
height: 24px;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 10px;
right: 10px;
text-align: center;
line-height: 24px;
z-index: 1;
cursor: pointer;
}
.upload__img-close:after {
content: "\2716";
font-size: 14px;
color: white;
}
.img-bg {
background-repeat: no-repeat;
background-position: center;
background-size: cover;
position: relative;
padding-bottom: 100%;
}
.dark-login {
height: 50px;
}
.light-login {
height: 50px;
}
.fl-wrapper {
z-index: 99999;
}
.dashboard-switch {
position: relative;
display: inline-block;
width: 90px;
height: 34px;
}
.dashboard-switch input {
display: none;
}
.dashboard-switch .slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ca2222;
-webkit-transition: 0.4s;
transition: 0.4s;
}
.dashboard-switch .slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white; background-color: white;
-webkit-transition: 0.4s; color: black;
transition: 0.4s; } */
}
.dashboard-switch input:checked + .slider {
background-color: #2ab934;
}
.dashboard-switch input:focus + .slider {
box-shadow: 0 0 1px #2196f3;
}
.dashboard-switch input:checked + .slider:before {
-webkit-transform: translateX(55px);
-ms-transform: translateX(55px);
transform: translateX(55px);
}
.dashboard-switch .on {
display: none;
}
.dashboard-switch .on,
.dashboard-switch .off {
color: white;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
font-size: 12px;
user-select: none;
}
.dashboard-switch .on{
left: 40%;
}
.dashboard-switch .off{
right: 10% !important;
}
.dashboard-switch input:checked + .slider .on {
display: block;
}
.dashboard-switch input:checked + .slider .off {
display: none;
}
.dashboard-switch .slider.round {
border-radius: 34px;
}
.dashboard-switch .slider.round:before {
border-radius: 50%;
}

View File

@@ -37,6 +37,10 @@ body {
font-family: 'Outfit', sans-serif; font-family: 'Outfit', sans-serif;
/* font-weight: normal; */ /* font-weight: normal; */
} }
p{
font-size: 16px;
color: black;
}
.text-brand{ .text-brand{
@@ -614,13 +618,13 @@ z-index: 10000;
transition: .3s all ease-in-out; transition: .3s all ease-in-out;
} }
.col.col-md-3:nth-child(1) .course-box img, .col.col-md-3:nth-child(2) .course-box img{ .col.col-md-3:nth-child(1) .course-box img, .col.col-md-3:nth-child(2) .course-box img{
width: 100%; width: 100px;
} }
.col.col-md-3:nth-child(4) .course-box img { .col.col-md-3:nth-child(3) .course-box img {
width: 125px; width: 125px;
} }
.col.col-md-3:nth-child(4) .course-box img { .col.col-md-3:nth-child(4) .course-box img {
width: 120px; width: 110px;
} }
.how-it-work input, .how-it-work textarea { .how-it-work input, .how-it-work textarea {

View File

@@ -424,6 +424,9 @@ color: white;
margin: 20px 0; margin: 20px 0;
} }
.mySwiper-text .swiper-slide .box img{
object-fit: cover;
}
.mySwiper-text .swiper-button-next::after, .mySwiper-text .swiper-button-prev::after{ .mySwiper-text .swiper-button-next::after, .mySwiper-text .swiper-button-prev::after{

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

Some files were not shown because too many files have changed in this diff Show More