src/Controllers/TicketsController.php
public function complete($id)
    {
        if ($this->permToClose($id) == 'yes') {
            $ticket = $this->tickets->findOrFail($id);
            $ticket->completed_at = Carbon::now();

            if (Setting::grab('default_close_status_id')) {
                $ticket->status_id = Setting::grab('default_close_status_id');
            }

            $subject = $ticket->subject;
            $ticket->save();

            session()->flash('status', trans('ticketit::lang.the-ticket-has-been-completed', ['name' => $subject]));

            return redirect()->route(Setting::grab('main_route').'.index');
        }

        return redirect()->route(Setting::grab('main_route').'.index')
            ->with('warning', trans('ticketit::lang.you-are-not-permitted-to-do-this'));
    }
public function complete($id)
    {
        if ($this->permToClose($id) == 'yes') {
            $ticket = $this->tickets->findOrFail($id);
            $ticket->completed_at = Carbon::now();

            if (Setting::grab('default_close_status_id')) {
                $ticket->status_id = Setting::grab('default_close_status_id');
            }

            $subject = $ticket->subject;
            $ticket->save();

            session()->flash('status', trans('ticketit::lang.the-ticket-has-been-completed', ['name' => $subject]));

            return redirect()->route(Setting::grab('main_route').'.index');
        }

        return redirect()->route(Setting::grab('main_route').'.index')
            ->with('warning', trans('ticketit::lang.you-are-not-permitted-to-do-this'));
    }
public function complete ( $ id ) { if ( $ this -> permToClose ( $ id ) == 'yes' ) { $ ticket = $ this -> tickets -> findOrFail ( $ id ) ; $ ticket -> completed_at = Carbon :: now ( ) ; if ( Setting :: grab ( 'default_close_status_id' ) ) { $ ticket -> status_id = Setting :: grab ( 'default_close_status_id' ) ; } $ subject = $ ticket -> subject ; $ ticket -> save ( ) ; session ( ) -> flash ( 'status' , trans ( 'ticketit::lang.the-ticket-has-been-completed' , [ 'name' => $ subject ] ) ) ; return redirect ( ) -> route ( Setting :: grab ( 'main_route' ) . '.index' ) ; } return redirect ( ) -> route ( Setting :: grab ( 'main_route' ) . '.index' ) -> with ( 'warning' , trans ( 'ticketit::lang.you-are-not-permitted-to-do-this' ) ) ; }
Mark ticket as complete.

@param int $id

@return Response
Mark ticket as complete .