diff --git a/app/Http/Controllers/API/AuthController.php b/app/Http/Controllers/API/AuthController.php index 1f9f623f..41edf323 100755 --- a/app/Http/Controllers/API/AuthController.php +++ b/app/Http/Controllers/API/AuthController.php @@ -70,14 +70,14 @@ public function register(RegisterRequest $request){ { $client->verification_token = rand(10000, 99999); - try{ + //try{ Mail::to($request->email) ->queue(new EmailVerification($request->firstname, $client->verification_token)); - }catch (\Exception $ex){ - //eger email ugradyp bolmasa verification edip bolmaz - $client->is_verified = true; - Log::error($ex->getMessage()); - } + // }catch (\Exception $ex){ + // //eger email ugradyp bolmasa verification edip bolmaz + // $client->is_verified = true; + // Log::error($ex->getMessage()); + // } } diff --git a/app/Http/Controllers/API/TicketController.php b/app/Http/Controllers/API/TicketController.php index 5c5109b7..dc20a6ff 100755 --- a/app/Http/Controllers/API/TicketController.php +++ b/app/Http/Controllers/API/TicketController.php @@ -48,15 +48,10 @@ public function postMessage(MessageRequest $request) { try{ $message = new Message($request->only(['ticket_id', 'content'])); - $message['is_client'] = true; - $message->save(); - $ticket = Ticket::find($request->ticket_id); - $ticket['last_sender'] = 'client'; - $ticket->save(); return MessageResource::make($message); @@ -70,15 +65,10 @@ public function postMessageAdmin(MessageRequest $request) { try{ $message = new Message($request->only(['ticket_id', 'content', 'admin_id', 'status_id'])); - $message['is_client'] = false; - $message->save(); - $ticket = Ticket::find($request->ticket_id); - $ticket['last_sender'] = 'admin'; - $ticket->save(); return MessageResource::make($message); @@ -104,23 +94,21 @@ public function getTickets(Request $request) public function postTicket(TicketRequest $request) { $ticket = new Ticket($request->only('content', 'title','category_id')); - $client = $request->user(); $account = Account::find($client->account_id); - $ticket['client_id'] = $account->id; - $status = Status::where('name', 'Open')->firstOrFail(); - $ticket['status_id'] = $status->id; - $ticket['last_sender'] = 'client'; - $ticket->save(); Message::create(['ticket_id' => $ticket->id, 'content' => $request->get("content"),'is_client' => true]); - return TicketResource::make($ticket); } + //create ticket inside application preview - admin panel + public function createAppTicket(Request $request){ + $ticket = new Ticket($request->only('content', 'title','category_id', 'application_id')); + } + } diff --git a/app/Http/Controllers/Admin/TicketCrudController.php b/app/Http/Controllers/Admin/TicketCrudController.php index 2bdd48d4..8b3aa757 100755 --- a/app/Http/Controllers/Admin/TicketCrudController.php +++ b/app/Http/Controllers/Admin/TicketCrudController.php @@ -101,7 +101,7 @@ protected function setupCreateOperation() 'label' => "Account", 'type' => 'custom_select_account', 'name' => 'client_id', // the method that defines the relationship in your Model - 'entity' => 'client', // the method that defines the relationship in your Model + 'entity' => 'account', // the method that defines the relationship in your Model 'model' => "App\Models\Account", // foreign key model 'attribute_1' => 'name', // foreign key attribute that is shown to user 'attribute_2' => 'surname', diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5bc..93e59895 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -6,16 +6,6 @@ class AppServiceProvider extends ServiceProvider { - /** - * Register any application services. - * - * @return void - */ - public function register() - { - // - } - /** * Bootstrap any application services. * @@ -23,6 +13,29 @@ public function register() */ public function boot() { - // + $this->overrideConfigValues(); } + + /** + * Register any application services. + * + * @return void + */ + public function register() + { + + } + + protected function overrideConfigValues() + { + $config = []; + $config['mail.mailers.smtp.host'] = config('settings.smtp_host'); + $config['mail.mailers.smtp.port'] = config('settings.smtp_port'); + $config['mail.mailers.smtp.encryption'] = config('settings.smtp_encryption'); + $config['mail.mailers.smtp.username'] = config('settings.smtp_username'); + $config['mail.mailers.smtp.password'] = config('settings.smtp_password'); + $config['mail.mailers.smtp.from.address'] = config('settings.smtp_username'); + $config['mail.mailers.smtp.from.name'] = 'Birzha Legalizasia'; + config($config); + } } diff --git a/resources/views/admin/application_ticket.blade.php b/resources/views/admin/application_ticket.blade.php new file mode 100644 index 00000000..1d0e6944 --- /dev/null +++ b/resources/views/admin/application_ticket.blade.php @@ -0,0 +1,228 @@ +@extends(backpack_view('blank')) + +@section('content') + + + + + +
| Name | +Size (Kb) | +Type | +
|---|---|---|
| + + {{ $attachment->name }} + + | ++ {{ $attachment->size }} Kb + | ++ {{ $application->type }} + | +