Files
faveo/app/Http/Controllers/Admin/helpdesk/CloseWrokflowController.php
Shift 87acc30a0b Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.

You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.

For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
2023-01-07 20:32:31 +00:00

66 lines
2.0 KiB
PHP

<?php
namespace App\Http\Controllers\Admin\helpdesk;
use App\Http\Controllers\Controller;
use App\Http\Requests\helpdesk\WorkflowCloseRequest;
use App\Model\helpdesk\Workflow\WorkflowClose;
use Lang;
/**
* |=================================================
* | CloseWrokflowController
* |=================================================
* In this controller the functionalities fo close ticket workflow defined.
*/
class CloseWrokflowController extends Controller
{
private $security;
public function __construct(WorkflowClose $security)
{
$this->security = $security;
}
/**
* get the workflow settings page.
*
* @param \App\Model\helpdesk\Workflow\WorkflowClose $securitys
* @return type view
*/
public function index(WorkflowClose $securitys)
{
try {
$security = $securitys->whereId('1')->first();
return view('themes.default1.admin.helpdesk.settings.close-workflow.index', compact('security'));
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
}
/**
* updating the workflow settings for closing ticket.
*
* @param type $id
* @param \App\Http\Requests\helpdesk\WorkflowCloseRequest $request
* @return type redirect
*/
public function update($id, WorkflowCloseRequest $request)
{
try {
$security = new WorkflowClose();
$securitys = $security->whereId($id)->first();
$securitys->days = $request->input('days');
// $securitys->condition = $request->input('condition');
$securitys->send_email = $request->input('send_email');
$securitys->status = $request->input('status');
$securitys->save();
return \Redirect::back()->with('success', Lang::get('lang.successfully_saved_your_settings'));
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
}
}