+ {{$ticket->title}} +
+ ++ {{$ticket->user->name}} +
+ {{$ticket->answer}} + + {{$ticket->created_at->ldate('Y-m-d H:i')}} + ++ {{$ticket->user->name}} +
+ {{$t->answer}} + + {{$t->updated_at->ldate('Y-m-d H:i')}} + ++
+ +
diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php
index 2c1b406..5f418b8 100644
--- a/app/Http/Controllers/CustomerController.php
+++ b/app/Http/Controllers/CustomerController.php
@@ -6,6 +6,7 @@ use App\Models\Address;
use App\Models\Customer;
use App\Models\Invoice;
use App\Models\Product;
+use App\Models\Ticket;
use Illuminate\Http\Request;
use Illuminate\Validation\Rules\In;
@@ -167,5 +168,41 @@ class CustomerController extends Controller
}
+ public function submitTicket(Request $request){
+ $request->validate([
+ 'title' => ['required', 'string', 'max:255'],
+ 'body' => ['required', 'string'],
+ ]);
+
+ $ticket = new Ticket();
+ $ticket->title = $request->title;
+ $ticket->body = trim($request->body);
+ $ticket->customer_id = auth('customer')->user()->id;
+ $ticket->save();
+ return redirect()->route('client.profile')->with('message', __('Ticket added successfully'));
+ }
+
+ public function showTicket(Ticket $ticket){
+ return view('client.ticket',compact('ticket'));
+ }
+
+
+ public function ticketAnswer(Ticket $ticket, Request $request){
+
+ $request->validate([
+ 'body' => ['required', 'string'],
+ ]);
+
+ $ticket->status = "PENDING";
+ $ticket->save();
+
+ $nticket = new Ticket();
+ $nticket->parent_id = $ticket->id;
+ $nticket->body = trim($request->body);
+ $nticket->customer_id = auth('customer')->user()->id;
+ $nticket->save();
+ return redirect(route('client.profile').'#tickets')->with('message', __('Ticket answered successfully'));
+ }
+
}
diff --git a/resources/sass/client-custom/_general.scss b/resources/sass/client-custom/_general.scss
index 632e22e..b47178a 100644
--- a/resources/sass/client-custom/_general.scss
+++ b/resources/sass/client-custom/_general.scss
@@ -18,26 +18,26 @@
background: var(--xshop-secondary);
}
-*{
- font-family: 'Vazirmatn' , sans-serif;
+* {
+ font-family: 'Vazirmatn', sans-serif;
}
html {
scroll-behavior: smooth;
}
-body{
+body {
background: var(--xshop-background);
color: var(--xshop-text);
overflow-x: hidden;
}
-#website-preloader{
+#website-preloader {
transition: 500ms;
}
-.color-bullet{
+.color-bullet {
width: 25px;
height: 25px;
margin: auto;
@@ -45,7 +45,7 @@ body{
}
-#do-edit{
+#do-edit {
position: fixed;
inset-inline-start: 0;
top: 5%;
@@ -56,35 +56,74 @@ body{
width: 50px;
opacity: .4;
transition: 1s;
- &:hover{
+
+ &:hover {
opacity: 1;
}
- i{
+
+ i {
font-size: 25px;
}
}
-[id^="hidden-img"]{
+[id^="hidden-img"] {
display: none;
}
-#hidden-images{
+
+#hidden-images {
display: none;
}
-.color-bullet{
+.color-bullet {
border-radius: 50%;
width: 25px;
height: 25px;
border: 1px solid gray;
}
-#tabs-content{
- .tab{
+#tabs-content {
+ .tab {
display: none;
- &.active{
+ &.active {
display: block;
}
}
}
+
+
+#ticket-content {
+ padding: 2rem;
+
+ h1 {
+ font-size: 24px;
+ }
+
+ .overflow-hidden {
+ margin-bottom: 1rem;
+ }
+
+ .t-answer, .t-message {
+ width: 45%;
+ padding: 1rem;
+ border-radius: var(--xshop-border-radius);
+
+ .t-time {
+ opacity: .5;
+ display: block;
+ text-align: end;
+ margin-top: 7px;
+ }
+ }
+
+ .t-message {
+ background: var(--xshop-primary);
+ color: var(--xshop-diff);
+ }
+
+ .t-answer {
+ background: var(--xshop-secondary);
+ color: var(--xshop-diff2);
+ }
+}
diff --git a/resources/views/client/ticket.blade.php b/resources/views/client/ticket.blade.php
new file mode 100644
index 0000000..0816165
--- /dev/null
+++ b/resources/views/client/ticket.blade.php
@@ -0,0 +1,84 @@
+@extends('website.inc.website-layout')
+
+@section('title')
+ {{$ticket->title}} - {{config('app.name')}}
+@endsection
+@section('content')
+
+ {{$ticket->title}}
+
+
+
+ {{$ticket->user->name}}
+
+ {{$ticket->answer}}
+
+ {{$ticket->created_at->ldate('Y-m-d H:i')}}
+
+
+ {{$ticket->user->name}}
+
+ {{$t->answer}}
+
+ {{$t->updated_at->ldate('Y-m-d H:i')}}
+
+
+
+
+
+ # + | ++ {{__("Title")}} + | ++ {{__("Status")}} + | ++ - + | +
---|---|---|---|
+ {{$i+1}} + | ++ {{$ticket->title}} + | ++ {{__($ticket->status)}} + | ++ + + {{__("View")}} + + | +