update for version 1.0.2
This commit is contained in:
@@ -46,49 +46,49 @@ class Handler extends ExceptionHandler {
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
return response()->view('errors.404', []);
|
||||
} else {
|
||||
if(\Config::get('database.install') == 1) {
|
||||
// if(\Config::get('app.ErrorLog') == '%1%') {
|
||||
// \App\Http\Controllers\Common\SettingsController::smtp();
|
||||
// \Mail::send('errors.report', array('e' => $e), function ($message) {
|
||||
// $message->to('', '')->subject('');
|
||||
// });
|
||||
// }
|
||||
}
|
||||
return response()->view('errors.500', []);
|
||||
}
|
||||
return parent::render($request, $e);
|
||||
// if ($this->isHttpException($e) && $e->getStatusCode() == 404) {
|
||||
// return response()->view('errors.404', []);
|
||||
// } else {
|
||||
// if(\Config::get('database.install') == 1) {
|
||||
// // if(\Config::get('app.ErrorLog') == '%1%') {
|
||||
// // \App\Http\Controllers\Common\SettingsController::smtp();
|
||||
// // \Mail::send('errors.report', array('e' => $e), function ($message) {
|
||||
// // $message->to('', '')->subject('');
|
||||
// // });
|
||||
// // }
|
||||
// }
|
||||
// return response()->view('errors.500', []);
|
||||
// }
|
||||
// return parent::render($request, $e);
|
||||
|
||||
// if ($this->isHttpException($e))
|
||||
// {
|
||||
// return $this->renderHttpException($e);
|
||||
// }
|
||||
if ($this->isHttpException($e))
|
||||
{
|
||||
return $this->renderHttpException($e);
|
||||
}
|
||||
|
||||
|
||||
// if (config('app.debug'))
|
||||
// {
|
||||
// return $this->renderExceptionWithWhoops($e);
|
||||
// }
|
||||
if (config('app.debug'))
|
||||
{
|
||||
return $this->renderExceptionWithWhoops($e);
|
||||
}
|
||||
|
||||
// return parent::render($request, $e);
|
||||
return parent::render($request, $e);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// protected function renderExceptionWithWhoops(Exception $e)
|
||||
// {
|
||||
// $whoops = new \Whoops\Run;
|
||||
// $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||
protected function renderExceptionWithWhoops(Exception $e)
|
||||
{
|
||||
$whoops = new \Whoops\Run;
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||
|
||||
// return new \Illuminate\Http\Response(
|
||||
// $whoops->handleException($e),
|
||||
// $e->getStatusCode(),
|
||||
// $e->getHeaders()
|
||||
// );
|
||||
// }
|
||||
return new \Illuminate\Http\Response(
|
||||
$whoops->handleException($e),
|
||||
$e->getStatusCode(),
|
||||
$e->getHeaders()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -69,8 +69,7 @@ class MailController extends Controller {
|
||||
die('Mailbox is empty');
|
||||
}
|
||||
// dd($mailsIds);
|
||||
foreach($mailsIds as $mailId)
|
||||
{
|
||||
foreach($mailsIds as $mailId) {
|
||||
$overview = $mailbox->get_overview($mailId);
|
||||
$var = $overview[0]->seen ? 'read' : 'unread';
|
||||
if ($var == 'unread') {
|
||||
@@ -82,8 +81,7 @@ class MailController extends Controller {
|
||||
}
|
||||
$body = $mail->textHtml;
|
||||
// dd($mailId);
|
||||
if($body == null)
|
||||
{
|
||||
if($body == null) {
|
||||
$body = $mailbox->backup_getmail($mailId);
|
||||
$body = str_replace('\r\n', '<br/>', $body);
|
||||
// var_dump($body);
|
||||
@@ -112,8 +110,7 @@ class MailController extends Controller {
|
||||
$thread_id = Ticket_Thread::whereRaw('id = (select max(`id`) from ticket_thread)')->first();
|
||||
$thread_id = $thread_id->id;
|
||||
|
||||
foreach($mail->getAttachments() as $attachment)
|
||||
{
|
||||
foreach($mail->getAttachments() as $attachment) {
|
||||
$support = "support";
|
||||
// echo $_SERVER['DOCUMENT_ROOT'];
|
||||
$dir_img_paths = __DIR__;
|
||||
@@ -132,7 +129,6 @@ class MailController extends Controller {
|
||||
$pos = strpos($body, $filepath[1]);
|
||||
|
||||
if($pos == false) {
|
||||
|
||||
if($settings_email->first()->attachment == 1) {
|
||||
$upload = new Ticket_attachments;
|
||||
$upload->file = $file_data;
|
||||
|
@@ -13,6 +13,7 @@ use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\Model\helpdesk\Ticket\Ticket_attachments;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Collaborator;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
use App\Model\helpdesk\Ticket\Ticket_Priority;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Settings\Alert;
|
||||
@@ -56,6 +57,135 @@ class TicketController extends Controller {
|
||||
return view('themes.default1.agent.helpdesk.ticket.inbox');
|
||||
}
|
||||
|
||||
public function get_inbox() {
|
||||
return \Datatable::collection(Tickets::where('status', '=', 1)->orderBy('id', 'DESC')->get())
|
||||
->searchColumns('subject')
|
||||
->orderColumns('ticket_number')
|
||||
|
||||
->addColumn('checkbox', function ($ticket) {
|
||||
return "<input type='checkbox' class='icheckbox_flat-blue' name='select_all' value=".$ticket->id."/>";
|
||||
})
|
||||
|
||||
->addColumn('name', function ($ticket) {
|
||||
$title = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first();
|
||||
$string = strip_tags($title->title);
|
||||
if($title)
|
||||
if($title == null){
|
||||
} else {
|
||||
$collaborators = Ticket_Collaborator::where('ticket_id','=',$ticket->id)->get();
|
||||
$collab = count($collaborators);
|
||||
// check atatchments
|
||||
$attachments = Ticket_attachments::where('thread_id','=',$title->id)->first();
|
||||
$attach = count($attachments);
|
||||
if (strlen($string) > 40) {
|
||||
$stringCut = substr($string, 0, 40);
|
||||
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).' ...';
|
||||
}
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::where('id', '=', $TicketData)->first();
|
||||
$LastResponse = User::where('id', '=', $TicketDatarow->user_id)->first();
|
||||
if($LastResponse->role == "user") {
|
||||
$rep = "#F39C12";
|
||||
$username = $LastResponse->user_name;
|
||||
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
|
||||
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
|
||||
$username = $LastResponse->user_name;
|
||||
}
|
||||
}
|
||||
$titles = Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
|
||||
$count = count($titles);
|
||||
foreach($titles as $title) {
|
||||
$title = $title;
|
||||
}
|
||||
$assigned_to = User::where('id','=',$ticket->assigned_to)->first();
|
||||
if($assigned_to == null) {
|
||||
$assigned = "Unassigned";
|
||||
} else {
|
||||
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
|
||||
}
|
||||
if($collab > 0) {
|
||||
$collabs = " <i class='fa fa-users'></i>";
|
||||
}
|
||||
if($attach > 0) {
|
||||
$attachs = " <i class='fa fa-paperclip'></i>";
|
||||
if($collab > 0) {
|
||||
$collabs = $collabs . $attachs;
|
||||
} else {
|
||||
$collabs = $attachs;
|
||||
}
|
||||
}
|
||||
return "<a href=".route('ticket.thread',[$ticket->id])." title=". $title->title .">".$string."</a> (".$count.") <i class='fa fa-comment'></i>
|
||||
".$collab;
|
||||
}
|
||||
})
|
||||
|
||||
->addColumn('Ticket ID', function ($ticket) {
|
||||
$ticket_number = "<a href='". route('ticket.thread',[$ticket->id]) ."' title=''># ".$ticket->ticket_number."</a>";
|
||||
return $ticket_number;
|
||||
})
|
||||
|
||||
->addColumn('Priority', function ($ticket) {
|
||||
$priority = Ticket_Priority::where('priority_id', '=', $ticket->priority_id)->first();
|
||||
return "<td class='mailbox-priority'><spam style='color:green;'>".$priority->priority_desc."</spam></td>";
|
||||
// return TicketController::usertimezone($st);
|
||||
})
|
||||
|
||||
->addColumn('From', function ($ticket) {
|
||||
$from = User::where('id','=',$ticket->user_id)->first();
|
||||
if($from->role == "user") {
|
||||
return $from->user_name;
|
||||
} else {
|
||||
return $from->first_name." ".$from->last_name;
|
||||
}
|
||||
})
|
||||
|
||||
->addColumn('Last Replier', function ($ticket) {
|
||||
$TicketData = Ticket_Thread::where('ticket_id', '=', $ticket->id)->max('id');
|
||||
$TicketDatarow = Ticket_Thread::where('id', '=', $TicketData)->first();
|
||||
$LastResponse = User::where('id', '=', $TicketDatarow->user_id)->first();
|
||||
if($LastResponse->role == "user") {
|
||||
$rep = "#F39C12";
|
||||
$username = $LastResponse->user_name;
|
||||
} else { $rep = "#000"; $username = $LastResponse->first_name ." ". $LastResponse->last_name;
|
||||
if($LastResponse->first_name==null || $LastResponse->last_name==null) {
|
||||
$username = $LastResponse->user_name;
|
||||
}}
|
||||
return $username;
|
||||
})
|
||||
|
||||
->addColumn('Assigned To', function ($ticket) {
|
||||
$assigned_to = User::where('id','=',$ticket->assigned_to)->first();
|
||||
if($assigned_to == null) {
|
||||
$assigned = "Unassigned";
|
||||
} else {
|
||||
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
|
||||
}
|
||||
return $assigned;
|
||||
})
|
||||
|
||||
->addColumn('Last Activity', function ($ticket) {
|
||||
$assigned_to = User::where('id','=',$ticket->assigned_to)->first();
|
||||
if($assigned_to == null) {
|
||||
$assigned = "Unassigned";
|
||||
} else {
|
||||
$assigned = $assigned_to->first_name ." ". $assigned_to->last_name;
|
||||
}
|
||||
return $assigned;
|
||||
})
|
||||
|
||||
->addColumn('Last Activity', function ($ticket) {
|
||||
$titles = Ticket_Thread::where('ticket_id', '=', $ticket->id)->get();
|
||||
$count = count($titles);
|
||||
foreach($titles as $title) {
|
||||
$title = $title;
|
||||
}
|
||||
return TicketController::usertimezone($title->created_at);
|
||||
})
|
||||
|
||||
->make();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the Open ticket list page
|
||||
* @return type response
|
||||
@@ -429,8 +559,8 @@ class TicketController extends Controller {
|
||||
// mail user his/her password
|
||||
if ($user->save()) {
|
||||
$user_id = $user->id;
|
||||
if (Mail::send('emails.pass', ['password' => $password, 'name' => $username, 'from'=>$company], function ($message) use ($emailadd, $username) {
|
||||
$message->to($emailadd, $username)->subject('password');
|
||||
if (Mail::send('emails.pass', ['password' => $password, 'name' => $username, 'from'=>$company], function ($message) use ($emailadd, $username,$company) {
|
||||
$message->to($emailadd, $username)->subject('Welcome to '.$company.' helpdesk');
|
||||
})) {
|
||||
// need to do something here....
|
||||
}
|
||||
|
270
code/app/Http/Controllers/Agent/kb/ArticleController.php
Normal file
270
code/app/Http/Controllers/Agent/kb/ArticleController.php
Normal file
@@ -0,0 +1,270 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||
use App\Http\Controllers\Client\kb\UserController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Requests\kb\ArticleRequest;
|
||||
use App\Model\kb\Article;
|
||||
use App\Model\kb\Category;
|
||||
use App\Model\kb\Relationship;
|
||||
use App\Model\kb\Settings;
|
||||
use Auth;
|
||||
use Chumper\Datatable\Table;
|
||||
use Datatable;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Model\kb\Comment;
|
||||
|
||||
/* include the article model to access the article table */
|
||||
use Redirect;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* ArticleController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
|
||||
class ArticleController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
SettingsController::language();
|
||||
}
|
||||
public function test() {
|
||||
//$table = $this->setDatatable();
|
||||
return view('themes.default1.agent.kb.article.test');
|
||||
|
||||
}
|
||||
public function getData() {
|
||||
|
||||
//return 'kfjhje';
|
||||
|
||||
return Datatable::collection(Article::All())
|
||||
->searchColumns('name')
|
||||
->orderColumns('name', 'description')
|
||||
->addColumn('name', function ($model) {
|
||||
return $model->name;
|
||||
})
|
||||
->addColumn('Created', function ($model) {
|
||||
$t = $model->created_at;
|
||||
return TicketController::usertimezone($t);
|
||||
})
|
||||
->addColumn('Actions', function ($model) {
|
||||
//return '<a href=article/delete/ ' . $model->id . ' class="btn btn-danger btn-flat" onclick="myFunction()">Delete</a> <a href=article/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=show/' . $model->id . ' class="btn btn-warning btn-flat">View</a>';
|
||||
//return '<form action="article/delete/ ' . $model->id . '" method="post" onclick="alert()"><button type="sumbit" value="Delete"></button></form><a href=article/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=show/' . $model->id . ' class="btn btn-warning btn-flat">View</a>';
|
||||
return '<span data-toggle="modal" data-target="#banemail"><a href="#" ><button class="btn btn-danger btn-xs"></a> ' . \Lang::get('lang.delete') . ' </button></span> <a href=article/' . $model->slug . '/edit class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a> <a href=show/'.$model->slug .' class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>
|
||||
<div class="modal fade" id="banemail">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Are You Sure ?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
'.$model->name.'
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||
<a href="article/delete/'.$model->slug.'"><button class="btn btn-danger">delete</button></a>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>';
|
||||
})
|
||||
->make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Index for Articles
|
||||
* @param type Article $article
|
||||
* @return type Response
|
||||
*/
|
||||
public function index() {
|
||||
/* show the index page with article list */
|
||||
return view('themes.default1.agent.kb.article.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creating a Article
|
||||
* @param type Category $category
|
||||
* @return type Response
|
||||
*/
|
||||
public function create(Category $category) {
|
||||
//$cat = $category->whereId(33)->first();
|
||||
//$tm = $cat->created_at;
|
||||
//$this->usertimezone($tm);
|
||||
// // /* get the attributes of the category */
|
||||
$category = $category->lists('id', 'name');
|
||||
/* get the create page */
|
||||
return view('themes.default1.agent.kb.article.create', compact('category'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the values to the article table
|
||||
* @param type Article $article
|
||||
* @param type ArticleRequest $request
|
||||
* @return type
|
||||
*/
|
||||
public function store(Article $article, ArticleRequest $request) {
|
||||
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
$article->slug = $slug;
|
||||
$article->fill($request->except('created_at','slug'))->save();
|
||||
$requests = $request->input('category_id');
|
||||
$id = $article->id;
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* insert the values to the article table */
|
||||
if ($article->fill($request->except('slug'))->save()) //true: redirect to index page with success message
|
||||
{
|
||||
return redirect('article')->with('success', 'Article Inserted Successfully');
|
||||
} else //redirect to index page with fail message
|
||||
{
|
||||
return redirect('article')->with('fails', 'Article Not Inserted');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit an Article by id
|
||||
* @param type Integer $id
|
||||
* @param type Article $article
|
||||
* @param type Relationship $relation
|
||||
* @param type Category $category
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($slug, Article $article, Relationship $relation, Category $category) {
|
||||
|
||||
$aid = $article->where('slug', $slug)->first();
|
||||
$id = $aid->id;
|
||||
|
||||
/* define the selected fields */
|
||||
$assign = $relation->where('article_id', $id)->lists('category_id');
|
||||
/* get the attributes of the category */
|
||||
$category = $category->lists('id', 'name');
|
||||
/* get the selected article and display it at edit page */
|
||||
/* Get the selected article with id */
|
||||
$article = $article->whereId($id)->first();
|
||||
/* send to the edit page */
|
||||
return view('themes.default1.agent.kb.article.edit', compact('assign', 'article', 'category'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an Artile by id
|
||||
* @param type Integer $id
|
||||
* @param type Article $article
|
||||
* @param type Relationship $relation
|
||||
* @param type ArticleRequest $request
|
||||
* @return Response
|
||||
*/
|
||||
public function update($slug, Article $article, Relationship $relation,
|
||||
ArticleRequest $request) {
|
||||
$aid = $article->where('slug', $slug)->first();
|
||||
$id = $aid->id;
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
$article->slug = $slug;
|
||||
/* get the attribute of relation table where id==$id */
|
||||
$relation = $relation->where('article_id', $id);
|
||||
$relation->delete();
|
||||
/* get the request of the current articles */
|
||||
$article = $article->whereId($id)->first();
|
||||
$requests = $request->input('category_id');
|
||||
$id = $article->id;
|
||||
foreach ($requests as $req) {
|
||||
DB::insert('insert into article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
|
||||
}
|
||||
/* update the value to the table */
|
||||
if ($article->fill($request->except('slug'))->save()) //true: redirect to index page with success message
|
||||
{
|
||||
return redirect('article')->with('success', 'Article Updated Successfully');
|
||||
} else // redirect to index page with fails message
|
||||
{
|
||||
return redirect('article')->with('fails', 'Article Not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an Agent by id
|
||||
* @param type $id
|
||||
* @param type Article $article
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($slug, Article $article, Relationship $relation, Comment $comment) {
|
||||
|
||||
/* delete the selected article from the table */
|
||||
$article = $article->where('slug',$slug)->first(); //get the selected article via id
|
||||
//dd($article);
|
||||
$id = $article->id;
|
||||
$comments = $comment->where('article_id',$id)->get();
|
||||
|
||||
if($comments)
|
||||
{
|
||||
foreach($comments as $comment)
|
||||
$comment->delete();
|
||||
}
|
||||
|
||||
$relation = $relation->where('article_id', $id)->first();
|
||||
if($relation)
|
||||
{
|
||||
$relation->delete();
|
||||
}
|
||||
if($article)
|
||||
{
|
||||
if ($article->delete()) //true:redirect to index page with success message
|
||||
{
|
||||
return Redirect::back()->with('success', 'Article Deleted Successfully');
|
||||
} else //redirect to index page with fails message
|
||||
{
|
||||
return Redirect::back()->with('fails', 'Article Not Deleted');
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return Redirect::back()->with('fails', 'Article can Not Deleted');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static function usertimezone($utc) {
|
||||
$user = Auth::user();
|
||||
$tz = $user->timezone;
|
||||
$set = Settings::whereId('1')->first();
|
||||
$format = $set->dateformat;
|
||||
//$utc = date('M d Y h:i:s A');
|
||||
//echo 'UTC : ' . $utc;
|
||||
date_default_timezone_set($tz);
|
||||
|
||||
$offset = date('Z', strtotime($utc));
|
||||
//print "offset: $offset \n";
|
||||
$date = date($format, strtotime($utc) + $offset);
|
||||
echo $date;
|
||||
//return substr($date, 0, -6);
|
||||
|
||||
}
|
||||
|
||||
}
|
194
code/app/Http/Controllers/Agent/kb/CategoryController.php
Normal file
194
code/app/Http/Controllers/Agent/kb/CategoryController.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
use App\Http\Controllers\client\kb\UserController;
|
||||
use App\Http\Controllers\admin\kb\ArticleController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||
use App\Http\Requests\kb\CategoryRequest;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Model\kb\Category;
|
||||
use App\Model\kb\Relationship;
|
||||
use Datatable;
|
||||
use Redirect;
|
||||
|
||||
/**
|
||||
* CategoryController
|
||||
*
|
||||
* @package Controllers
|
||||
* @subpackage Controller
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
|
||||
class CategoryController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
SettingsController::language();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indexing all Category
|
||||
* @param type Category $category
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
|
||||
/* get the view of index of the catogorys with all attributes
|
||||
of category model */
|
||||
return view('themes.default1.agent.kb.category.index');
|
||||
}
|
||||
public function getData() {
|
||||
|
||||
//return 'kfjhje';
|
||||
|
||||
return Datatable::collection(Category::All())
|
||||
->searchColumns('name')
|
||||
->orderColumns('name', 'description')
|
||||
->addColumn('name', function ($model) {
|
||||
return $model->name;
|
||||
})
|
||||
|
||||
->addColumn('Created', function ($model) {
|
||||
|
||||
$t = $model->created_at;
|
||||
return TicketController::usertimezone($t);
|
||||
})
|
||||
->addColumn('Actions', function ($model) {
|
||||
//return '<a href=category/delete/' . $model->id . ' class="btn btn-danger btn-flat">Delete</a> <a href=category/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=article-list class="btn btn-warning btn-flat">View</a>';
|
||||
return '<span data-toggle="modal" data-target="#banemail"><a href="#" ><button class="btn btn-danger btn-xs"></a>'. \Lang::get("lang.delete") .'</button></span> <a href=category/' . $model->slug . '/edit class="btn btn-warning btn-xs">'. \Lang::get("lang.edit") .'</a> <a href=article-list class="btn btn-primary btn-xs">'. \Lang::get("lang.view") .'</a>
|
||||
<div class="modal fade" id="banemail">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Are You Sure ?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
'.$model->name.'
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||
<a href="category/delete/' . $model->id . '"><button class="btn btn-danger">delete</button></a>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>';
|
||||
})
|
||||
->make();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Category
|
||||
* @param type Category $category
|
||||
* @return Response
|
||||
*/
|
||||
public function create(Category $category) {
|
||||
/* Get the all attributes in the category model */
|
||||
$category = $category->get();
|
||||
/* get the view page to create new category with all attributes
|
||||
of category model*/
|
||||
return view('themes.default1.agent.kb.category.create', compact('category'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function store(Category $category, CategoryRequest $request) {
|
||||
/* Get the whole request from the form and insert into table via model */
|
||||
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
|
||||
$category->slug = $slug;
|
||||
//$category->save();
|
||||
|
||||
if ($category->fill($request->except('slug'))->save()) //True: send success message to index page
|
||||
{
|
||||
return Redirect::back()->with('success', 'Category Inserted Successfully');
|
||||
} else //send fail to index page
|
||||
{
|
||||
return Redirect::back()->with('fails', 'Category Not Inserted');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit($slug, Category $category) {
|
||||
|
||||
$cid = $category->where('slug', $slug)->first();
|
||||
$id = $cid->id;
|
||||
/* get the atributes of the category model whose id == $id */
|
||||
$category = $category->whereId($id)->first();
|
||||
/* get the Edit page the selected category via id */
|
||||
return view('themes.default1.agent.kb.category.edit', compact('category'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function update($slug, Category $category, CategoryRequest $request) {
|
||||
|
||||
/* Edit the selected category via id */
|
||||
$category = $category->where('slug', $slug)->first();
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
|
||||
$category->slug = $slug;
|
||||
/* update the values at the table via model according with the request */
|
||||
if ($category->fill($request->except('slug'))->save()) //True: redirct to index page with success message
|
||||
{
|
||||
return redirect('category')->with('success', 'Category Updated Successfully');
|
||||
} else //redirect to index with fails message
|
||||
{
|
||||
return redirect('category')->with('fails', 'Category Not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function destroy($id, Category $category, Relationship $relation) {
|
||||
$relation = $relation->where('category_id', $id)->delete();
|
||||
// $relation->delete();
|
||||
/* delete the category selected, id == $id */
|
||||
$category = $category->whereId($id)->first();
|
||||
if ($category->delete()) //True: redirect to index with success message
|
||||
{
|
||||
return Redirect::back()->with('success', 'Category Deleted Successfully');
|
||||
} else //redirect to index page fails message
|
||||
{
|
||||
return Redirect::back()->with('fails', 'Category Not Deleted');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
154
code/app/Http/Controllers/Agent/kb/PageController.php
Normal file
154
code/app/Http/Controllers/Agent/kb/PageController.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
use App\Http\Controllers\client\kb\UserController;
|
||||
use App\Http\Controllers\Agent\kb\ArticleController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Agent\kb\SettingsController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Requests\kb\PageRequest;
|
||||
use App\Model\kb\Page;
|
||||
use Datatable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
/**
|
||||
* Contructor for both Authentication and Model Injecting
|
||||
* @param type Page $page
|
||||
* @return type
|
||||
*/
|
||||
public function __construct(Page $page) {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
$this->page = $page;
|
||||
SettingsController::language();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function index() {
|
||||
|
||||
$pages = $this->page->paginate(3);
|
||||
$pages->setPath('page');
|
||||
return view('themes.default1.agent.kb.pages.index', compact('pages'));
|
||||
|
||||
}
|
||||
|
||||
public function getData() {
|
||||
|
||||
//return 'kfjhje';
|
||||
|
||||
return Datatable::collection(Page::All())
|
||||
->searchColumns('name')
|
||||
->orderColumns('name', 'description', 'created')
|
||||
->addColumn('name', function ($model) {
|
||||
return $model->name;
|
||||
})
|
||||
|
||||
->addColumn('Created', function ($model) {
|
||||
|
||||
$t = $model->created_at;
|
||||
return TicketController::usertimezone($t);
|
||||
})
|
||||
->addColumn('Actions', function ($model) {
|
||||
|
||||
//return '<a href=page/delete/' . $model->id . ' class="btn btn-danger btn-flat">Delete</a> <a href=page/' . $model->id . '/edit class="btn btn-warning btn-flat">Edit</a> <a href=article-list class="btn btn-warning btn-flat">View</a>';
|
||||
return '<span data-toggle="modal" data-target="#banemail"><a href="#" ><button class="btn btn-danger btn-xs"></a> '. \Lang::get('lang.delete') .'</button></span> <a href=page/' . $model->slug . '/edit class="btn btn-warning btn-xs">'. \Lang::get('lang.edit') .'</a> <a href=pages/' . $model->slug . ' class="btn btn-primary btn-xs">'. \Lang::get('lang.view') .'</a>
|
||||
<div class="modal fade" id="banemail">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Are You Sure ?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
'.$model->name.'
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal" id="dismis2">Close</button>
|
||||
<a href="page/delete/' . $model->id . '"><button class="btn btn-danger">delete</button></a>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>';
|
||||
})
|
||||
->make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function create() {
|
||||
return view('themes.default1.agent.kb.pages.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* To insert a value to the table Page
|
||||
* @param type Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function store(PageRequest $request) {
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
|
||||
$this->page->slug = $slug;
|
||||
|
||||
$this->page->fill($request->except('slug'))->save();
|
||||
return redirect('page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($id) {
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* To edit a page
|
||||
* @param type $id
|
||||
* @return type
|
||||
*/
|
||||
public function edit($slug) {
|
||||
$page = $this->page->where('slug', $slug)->first();
|
||||
return view('themes.default1.agent.kb.pages.edit', compact('page'));
|
||||
}
|
||||
|
||||
/**
|
||||
* To update a page
|
||||
* @param type $id
|
||||
* @param type Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function update($slug, PageRequest $request) {
|
||||
$pages = $this->page->where('slug', $slug)->first();
|
||||
$sl = $request->input('slug');
|
||||
$slug = str_slug($sl, "-");
|
||||
|
||||
$this->page->slug = $slug;
|
||||
//$id = $page->id;
|
||||
$pages->fill($request->except('slug'))->save();
|
||||
return redirect('page')->with('success', 'Your Page Updated Successfully');
|
||||
}
|
||||
|
||||
/**
|
||||
* To Delete one Page
|
||||
* @param type $id
|
||||
* @return type
|
||||
*/
|
||||
public function destroy($id) {
|
||||
$page = $this->page->whereId($id)->first();
|
||||
$page->delete();
|
||||
return redirect('page')->with('success', 'Page Deleted Successfully');
|
||||
}
|
||||
|
||||
}
|
384
code/app/Http/Controllers/Agent/kb/SettingsController.php
Normal file
384
code/app/Http/Controllers/Agent/kb/SettingsController.php
Normal file
@@ -0,0 +1,384 @@
|
||||
<?php namespace App\Http\Controllers\Agent\kb;
|
||||
|
||||
use App\Http\Controllers\Agent\kb\ArticleController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\kb\FooterRequest;
|
||||
use App\Http\Requests\kb\ProfilePassword;
|
||||
use App\Http\Requests\kb\ProfileRequest;
|
||||
use App\Http\Requests\kb\SettingsRequests;
|
||||
use App\Http\Requests\kb\SocialRequest;
|
||||
use App\Model\kb\Comment;
|
||||
use App\Model\kb\DateFormat;
|
||||
use App\Model\kb\Faq;
|
||||
use App\Model\kb\Settings;
|
||||
use App\Model\kb\Side1;
|
||||
use App\Model\kb\Side2;
|
||||
use App\Model\kb\Social;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use Auth;
|
||||
use Config;
|
||||
use Datatable;
|
||||
use Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use Image;
|
||||
use Input;
|
||||
|
||||
class SettingsController extends Controller {
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('roles');
|
||||
$this->language();
|
||||
}
|
||||
|
||||
/**
|
||||
* to get the settings page
|
||||
* @return response
|
||||
* @package default
|
||||
*/
|
||||
public function settings(Settings $settings, Timezones $time, DateFormat $date) {
|
||||
|
||||
/* get the setting where the id == 1 */
|
||||
$settings = $settings->whereId('1')->first();
|
||||
$time = $time->get();
|
||||
//$date = $date->get();
|
||||
return view('themes.default1.agent.kb.settings.settings', compact('date', 'settings', 'time'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function postSettings($id, Settings $settings, SettingsRequests $request) {
|
||||
try
|
||||
{
|
||||
/* fetch the values of company request */
|
||||
$settings = $settings->whereId('1')->first();
|
||||
|
||||
if (Input::file('logo')) {
|
||||
$name = Input::file('logo')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'lb-faveo/dist/image';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('logo')->move($destinationPath, $fileName);
|
||||
|
||||
$settings->logo = $fileName;
|
||||
//$thDestinationPath = 'dist/th';
|
||||
|
||||
Image::make($destinationPath . '/' . $fileName, array(
|
||||
'width' => 300,
|
||||
'height' => 300,
|
||||
'grayscale' => false,
|
||||
))->save('lb-faveo/dist/image/' . $fileName);
|
||||
}
|
||||
if (Input::file('background')) {
|
||||
$name = Input::file('background')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'lb-faveo/dist/image';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
echo $fileName;
|
||||
|
||||
Input::file('background')->move($destinationPath, $fileName);
|
||||
|
||||
$settings->background = $fileName;
|
||||
//$thDestinationPath = 'dist/th';
|
||||
|
||||
Image::make($destinationPath . '/' . $fileName, array(
|
||||
'width' => 300,
|
||||
'height' => 300,
|
||||
'grayscale' => false,
|
||||
))->save('lb-faveo/dist/image/' . $fileName);
|
||||
}
|
||||
|
||||
/* Check whether function success or not */
|
||||
|
||||
if ($settings->fill($request->except('logo', 'background'))->save() == true) {
|
||||
/* redirect to Index page with Success Message */
|
||||
|
||||
return redirect('settings')->with('success', 'Settings Updated Successfully');
|
||||
} else {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('settings')->with('fails', 'Settings can not Updated');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
return redirect('settings')->with('fails', 'Settings can not Updated');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* to get the faq view page
|
||||
* @return response
|
||||
*/
|
||||
public function Faq(Faq $faq) {
|
||||
/* fetch the values of faq */
|
||||
$faq = $faq->whereId('1')->first();
|
||||
return view('themes.default1.agent.settings.faq', compact('faq'));
|
||||
|
||||
}
|
||||
public function postfaq($id, Faq $faq, Request $request) {
|
||||
$faq = $faq->whereId('1')->first();
|
||||
if ($faq->fill($request->input())->save()) {
|
||||
return redirect('create-faq')->with('success', 'Faq updated Successfully');
|
||||
} else {
|
||||
return redirect('craete-faq')->with('fails', 'Faq not updated');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get the create page to insert the values to database
|
||||
* @return type response
|
||||
*/
|
||||
public function CreateSocialLink(Social $social) {
|
||||
$social = $social->whereId('1')->first();
|
||||
return view('themes.default1.agent.kb.settings.social', compact('social'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type Social $social
|
||||
* @param type Request $request
|
||||
* @return type resonse
|
||||
*/
|
||||
public function PostSocial(Social $social, SocialRequest $request) {
|
||||
$social = $social->whereId('1')->first();
|
||||
if ($social->fill($request->input())->save()) {
|
||||
return redirect('social')->with('success', 'Your Social Links Stored');
|
||||
} else {
|
||||
return redirect('social')->with('fails', 'Sorry Can not Performe');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To Moderate the commenting
|
||||
* @param type Comment $comment
|
||||
* @return Response
|
||||
*/
|
||||
public function comment(Comment $comment) {
|
||||
return view('themes.default1.agent.kb.settings.comment');
|
||||
}
|
||||
|
||||
/**
|
||||
* getdata
|
||||
* @return type
|
||||
*/
|
||||
public function getData() {
|
||||
return \Datatable::collection(Comment::All())
|
||||
->searchColumns('name', 'email', 'comment', 'created')
|
||||
->orderColumns('name')
|
||||
->addColumn('name', function ($model) {
|
||||
return $model->name;
|
||||
})
|
||||
->addColumn('email', function ($model) {
|
||||
return $model->email;
|
||||
})
|
||||
->addColumn('website', function ($model) {
|
||||
return $model->website;
|
||||
})
|
||||
->addColumn('comment', function ($model) {
|
||||
return $model->comment;
|
||||
})
|
||||
->addColumn('status', function ($model) {
|
||||
$status = $model->status;
|
||||
if ($status == 1) {
|
||||
return '<p style="color:blue"">'.\Lang::get('lang.published');
|
||||
} else {
|
||||
return '<p style="color:red"">'.\Lang::get('lang.not_published');
|
||||
}
|
||||
})
|
||||
->addColumn('Created', function ($model) {
|
||||
return TicketController::usertimezone(date($model->created_at));
|
||||
})
|
||||
->addColumn('Actions', function ($model) {
|
||||
return '<a href=comment/delete/' . $model->id . ' class="btn btn-danger btn-xs">'.\Lang::get('lang.delete').'</a> <a href=published/' . $model->id . ' class="btn btn-warning btn-xs">'.\Lang::get('lang.publish').'</a>';
|
||||
})
|
||||
->make();
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin can publish the comment
|
||||
* @param type $id
|
||||
* @param type Comment $comment
|
||||
* @return bool
|
||||
*/
|
||||
public function publish($id, Comment $comment) {
|
||||
$comment = $comment->whereId($id)->first();
|
||||
$comment->status = 1;
|
||||
if ($comment->save()) {
|
||||
return redirect('comment')->with('success', $comment->name . '-' . 'Comment Published');
|
||||
} else {
|
||||
return redirect('comment')->with('fails', 'Can not Process');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* delete the comment
|
||||
* @param type $id
|
||||
* @param type Comment $comment
|
||||
* @return type
|
||||
*/
|
||||
public function delete($id, Comment $comment) {
|
||||
$comment = $comment->whereId($id)->first();
|
||||
if ($comment->delete()) {
|
||||
return redirect('comment')->with('success', $comment->name . "'s!" . 'Comment Deleted');
|
||||
} else {
|
||||
return redirect('comment')->with('fails', 'Can not Process');
|
||||
}
|
||||
}
|
||||
|
||||
public function getProfile() {
|
||||
$time = Timezone::all();
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.agent.kb.settings.profile', compact('user', 'time'));
|
||||
}
|
||||
|
||||
public function postProfile(ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
|
||||
if (is_null($user->profile_pic)) {
|
||||
if ($request->input('gender') == 1) {
|
||||
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/dist/img';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/dist/img';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
|
||||
$destinationPath = 'lb-faveo/dist/img';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
|
||||
$user->profile_pic = $fileName;
|
||||
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect()->back()->with('success1', 'Profile Updated sucessfully');
|
||||
|
||||
}
|
||||
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('profile')->with('success1', 'Profile Updated sucessfully');
|
||||
} else {
|
||||
return redirect('profile')->with('fails1', 'Profile Not Updated sucessfully');
|
||||
}
|
||||
|
||||
}
|
||||
public function postProfilePassword($id, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
return redirect('profile')->with('success2', 'Password Updated sucessfully');
|
||||
} else {
|
||||
return redirect('profile')->with('fails2', 'Old password Wrong');
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* To delete the logo
|
||||
* @param type $id
|
||||
* @param type Settings $setting
|
||||
* @return type
|
||||
*/
|
||||
public function deleteLogo($id, Settings $setting) {
|
||||
$setting = $setting->whereId($id)->first();
|
||||
$setting->logo = '';
|
||||
$setting->save();
|
||||
return redirect('settings')->with('success', 'Settings Updated Successfully');
|
||||
|
||||
}
|
||||
|
||||
public function deleteBackground($id, Settings $setting) {
|
||||
$setting = $setting->whereId($id)->first();
|
||||
$setting->background = '';
|
||||
$setting->save();
|
||||
return redirect('settings')->with('success', 'Settings Updated Successfully');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the View of create Side widget page
|
||||
* @param type Side1 $side
|
||||
* @return View
|
||||
*/
|
||||
public function side1(Side1 $side) {
|
||||
$side = $side->where('id', '1')->first();
|
||||
return view('themes.default1.agent.kb.settings.side1', compact('side'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post function of Side1 Page
|
||||
* @param type $id
|
||||
* @param type Side1 $side
|
||||
* @param type Request $request
|
||||
* @return view
|
||||
*/
|
||||
public function postside1($id, Side1 $side, Request $request) {
|
||||
$side = $side->whereId($id)->first();
|
||||
if ($side->fill($request->input())->save()) {
|
||||
return redirect('side1')->with('success', 'Side Widget 1 Created !');
|
||||
} else {
|
||||
return redirect('side1')->with('fails', 'Whoops ! Something went Wrong ! ');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the View for side widget creat
|
||||
* @param type Side2 $side
|
||||
* @return type
|
||||
*/
|
||||
public function side2(Side2 $side) {
|
||||
$side = $side->where('id', '1')->first();
|
||||
return view('themes.default1.agent.kb.settings.side2', compact('side'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post functio for side
|
||||
* @param type $id
|
||||
* @param type Side2 $side
|
||||
* @param type Request $request
|
||||
* @return response
|
||||
*/
|
||||
public function postside2($id, Side2 $side, Request $request) {
|
||||
$side = $side->whereId($id)->first();
|
||||
if ($side->fill($request->input())->save()) {
|
||||
return redirect('side2')->with('success', 'Side Widget 2 Created !');
|
||||
} else {
|
||||
return redirect('side2')->with('fails', 'Whoops ! Something went Wrong ! ');
|
||||
}
|
||||
}
|
||||
|
||||
static function language() {
|
||||
// $set = Settings::whereId(1)->first();
|
||||
// $lang = $set->language;
|
||||
Config::set('app.locale', 'en');
|
||||
Config::get('app');
|
||||
}
|
||||
|
||||
}
|
297
code/app/Http/Controllers/Client/kb/UserController.php
Normal file
297
code/app/Http/Controllers/Client/kb/UserController.php
Normal file
@@ -0,0 +1,297 @@
|
||||
<?php namespace App\Http\Controllers\client\kb;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\kb\CommentRequest;
|
||||
use App\Http\Requests\kb\ContactRequest;
|
||||
use App\Http\Requests\kb\SearchRequest;
|
||||
use App\Http\Requests\kb\ProfilePassword;
|
||||
use App\Model\kb\Article;
|
||||
use App\Model\kb\Category;
|
||||
use App\Model\kb\Comment;
|
||||
use App\Model\kb\Contact;
|
||||
use App\Model\kb\Faq;
|
||||
use App\Model\kb\Page;
|
||||
use App\Model\kb\Relationship;
|
||||
use App\Model\kb\Settings;
|
||||
use Config;
|
||||
// use Creativeorange\Gravatar\Gravatar;
|
||||
use Illuminate\Http\Request;
|
||||
use Mail;
|
||||
use Auth;
|
||||
use Redirect;
|
||||
use Hash;
|
||||
|
||||
class UserController extends Controller {
|
||||
|
||||
public function __construct() {
|
||||
//$this->middleware('auth');
|
||||
//SettingsController::language();
|
||||
// $this->port();
|
||||
// $this->host();
|
||||
// $this->password();
|
||||
// $this->encryption();
|
||||
// $this->email();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param
|
||||
* @return response
|
||||
* @package default
|
||||
*/
|
||||
public function getArticle(Article $article, Category $category, Settings $settings) {
|
||||
$settings = $settings->first();
|
||||
$pagination = $settings->pagination;
|
||||
// $article = $article->where('status', '1');
|
||||
// $article = $article->where('type', '1');
|
||||
$article = $article->paginate($pagination);
|
||||
// dd($article);
|
||||
$article->setPath('article-list');
|
||||
$categorys = $category->get();
|
||||
// $time = $this->timezone($utc);
|
||||
return view('themes.default1.client.kb.article-list.articles', compact('time', 'categorys', 'article'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get excerpt from string
|
||||
*
|
||||
* @param String $str String to get an excerpt from
|
||||
* @param Integer $startPos Position int string to start excerpt from
|
||||
* @param Integer $maxLength Maximum length the excerpt may be
|
||||
* @return String excerpt
|
||||
*/
|
||||
static function getExcerpt($str, $startPos = 0, $maxLength = 50) {
|
||||
if (strlen($str) > $maxLength) {
|
||||
$excerpt = substr($str, $startPos, $maxLength - 3);
|
||||
$lastSpace = strrpos($excerpt, ' ');
|
||||
$excerpt = substr($excerpt, 0, $lastSpace);
|
||||
$excerpt .= '...';
|
||||
} else {
|
||||
$excerpt = $str;
|
||||
}
|
||||
|
||||
return $excerpt;
|
||||
}
|
||||
|
||||
public function search(SearchRequest $request, Category $category, Article $article, Settings $settings) {
|
||||
$settings = $settings->first();
|
||||
$pagination = $settings->pagination;
|
||||
$search = $request->input('s');
|
||||
$result = $article->search($search)->paginate($pagination);
|
||||
$result->setPath('search');
|
||||
//dd($result);
|
||||
$categorys = $category->get();
|
||||
return view('themes.default1.client.kb.article-list.search', compact('categorys', 'result'));
|
||||
}
|
||||
|
||||
/**
|
||||
* to show the seleted article
|
||||
* @return response
|
||||
*/
|
||||
public function show($slug, Article $article, Category $category) {
|
||||
//ArticleController::timezone();
|
||||
$arti = $article->where('slug', $slug)->where('status','1')->where('type','1')->first();
|
||||
|
||||
// dd($arti);
|
||||
//$categorys = $category->get();
|
||||
//$avatar->get('vijaycodename47@gmail.com');
|
||||
return view('themes.default1.client.kb.article-list.show', compact('arti'));
|
||||
}
|
||||
|
||||
public function getCategory($slug, Article $article, Category $category, Relationship $relation) {
|
||||
/* get the article_id where category_id == current category */
|
||||
$catid = $category->where('slug', $slug)->first();
|
||||
$id = $catid->id;
|
||||
$all = $relation->where('category_id', $id)->paginate(2);
|
||||
$all->setPath('');
|
||||
/* from whole attribute pick the article_id */
|
||||
$article_id = $all->lists('article_id');
|
||||
$categorys = $category->get();
|
||||
/* direct to view with $article_id */
|
||||
return view('themes.default1.client.kb.article-list.category', compact('all', 'categorys', 'article_id'));
|
||||
}
|
||||
|
||||
public function home(Article $article, Category $category, Relationship $relation) {
|
||||
if (Config::get('database.install') == '%0%') {
|
||||
return redirect('step1');
|
||||
}
|
||||
else
|
||||
{
|
||||
//$categorys = $category->get();
|
||||
$categorys = $category->paginate(3);
|
||||
$categorys->setPath('home');
|
||||
/* direct to view with $article_id */
|
||||
return view('themes.default1.client.kb.article-list.home', compact('categorys', 'article_id'));
|
||||
}
|
||||
}
|
||||
|
||||
public function Faq(Faq $faq, Category $category) {
|
||||
$faq = $faq->where('id', '1')->first();
|
||||
$categorys = $category->get();
|
||||
return view('themes.default1.client.kb.article-list.faq', compact('categorys', 'faq'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get the contact page for user
|
||||
* @return response
|
||||
*/
|
||||
public function contact(Category $category, Settings $settings) {
|
||||
$settings = $settings->whereId('1')->first();
|
||||
$categorys = $category->get();
|
||||
return view('themes.default1.client.kb.article-list.contact', compact('settings', 'categorys'));
|
||||
}
|
||||
|
||||
/**
|
||||
* send message to the mail adderess that define in the system
|
||||
* @return response
|
||||
*/
|
||||
public function postContact(ContactRequest $request, Contact $contact) {
|
||||
$this->port();
|
||||
$this->host();
|
||||
$this->encryption();
|
||||
$this->email();
|
||||
$this->password();
|
||||
//return Config::get('mail');
|
||||
$contact->fill($request->input())->save();
|
||||
$name = $request->input('name');
|
||||
//echo $name;
|
||||
$email = $request->input('email');
|
||||
//echo $email;
|
||||
$subject = $request->input('subject');
|
||||
//echo $subject;
|
||||
$details = $request->input('message');
|
||||
//echo $message;
|
||||
//echo $contact->email;
|
||||
$mail = Mail::send('themes.default1.client.kb.article-list.contact-details', array('name' => $name, 'email' => $email, 'subject' => $subject, 'details' => $details), function ($message) use ($contact) {
|
||||
$message->to($contact->email, $contact->name)->subject('Contact');
|
||||
});
|
||||
if ($mail) {
|
||||
return redirect('contact')->with('success', 'Your details send to System');
|
||||
} else {
|
||||
return redirect('contact')->with('fails', 'Your details can not send to System');
|
||||
}
|
||||
}
|
||||
|
||||
public function contactDetails() {
|
||||
return view('themes.default1.client.kb.article-list.contact-details');
|
||||
}
|
||||
|
||||
/**
|
||||
* To insert the values to the comment table
|
||||
* @param type Article $article
|
||||
* @param type Request $request
|
||||
* @param type Comment $comment
|
||||
* @param type Id $id
|
||||
* @return type response
|
||||
*/
|
||||
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment) {
|
||||
$article = $article->where('slug',$slug)->first();
|
||||
$id = $article->id;
|
||||
$comment->article_id = $id;
|
||||
if ($comment->fill($request->input())->save()) {
|
||||
return Redirect::back()->with('success', 'Your comment posted');
|
||||
} else {
|
||||
return Redirect::back()->with('fails', 'Sorry not processed');
|
||||
}
|
||||
}
|
||||
|
||||
public function getPage($name, Page $page) {
|
||||
$page = $page->where('slug', $name)->first();
|
||||
//$this->timezone($page->created_at);
|
||||
return view('themes.default1.client.kb.article-list.pages', compact('page'));
|
||||
}
|
||||
static function port() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set('mail.port', $setting->port);
|
||||
}
|
||||
static function host() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set('mail.host', $setting->host);
|
||||
}
|
||||
static function encryption() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set(['mail.encryption' => $setting->encryption, 'mail.username' => $setting->email]);
|
||||
}
|
||||
static function email() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set(['mail.from' => ['address' => $setting->email, 'name' => 'asd']]);
|
||||
//dd(Config::get('mail'));
|
||||
}
|
||||
static function password() {
|
||||
$setting = Settings::whereId('1')->first();
|
||||
Config::set(['mail.password' => $setting->password, 'mail.sendmail' => $setting->email]);
|
||||
}
|
||||
|
||||
public function getCategoryList(Article $article, Category $category, Relationship $relation) {
|
||||
//$categorys = $category->get();
|
||||
$categorys = $category->paginate(3);
|
||||
$categorys->setPath('home');
|
||||
/* direct to view with $article_id */
|
||||
return view('themes.default1.client.kb.article-list.categoryList', compact('categorys', 'article_id'));
|
||||
|
||||
}
|
||||
|
||||
// static function timezone($utc) {
|
||||
// $set = Settings::whereId('1')->first();
|
||||
// $tz = $set->timezone;
|
||||
// $format = $set->dateformat;
|
||||
// //$utc = date('M d Y h:i:s A');
|
||||
// //echo 'UTC : ' . $utc;
|
||||
// date_default_timezone_set($tz);
|
||||
|
||||
// $offset = date('Z', strtotime($utc));
|
||||
// //print "offset: $offset \n";
|
||||
// $date = date($format, strtotime($utc) + $offset);
|
||||
// return $date;
|
||||
// //return substr($date, 0, -6);
|
||||
// }
|
||||
|
||||
public function clientProfile() {
|
||||
$user = Auth::user();
|
||||
return view('themes.default1.client.kb.article-list.profile', compact('user'));
|
||||
}
|
||||
|
||||
public function postClientProfile($id, ProfileRequest $request) {
|
||||
$user = Auth::user();
|
||||
$user->gender = $request->input('gender');
|
||||
$user->save();
|
||||
if ($user->profile_pic == 'avatar5.png' || $user->profile_pic == 'avatar2.png') {
|
||||
if ($request->input('gender') == 1) {
|
||||
$name = 'avatar5.png';
|
||||
$destinationPath = 'lb-faveo/dist/img';
|
||||
$user->profile_pic = $name;
|
||||
} elseif ($request->input('gender') == 0) {
|
||||
$name = 'avatar2.png';
|
||||
$destinationPath = 'lb-faveo/dist/img';
|
||||
$user->profile_pic = $name;
|
||||
}
|
||||
}
|
||||
if (Input::file('profile_pic')) {
|
||||
//$extension = Input::file('profile_pic')->getClientOriginalExtension();
|
||||
$name = Input::file('profile_pic')->getClientOriginalName();
|
||||
$destinationPath = 'lb-faveo/dist/img';
|
||||
$fileName = rand(0000, 9999) . '.' . $name;
|
||||
//echo $fileName;
|
||||
Input::file('profile_pic')->move($destinationPath, $fileName);
|
||||
$user->profile_pic = $fileName;
|
||||
} else {
|
||||
$user->fill($request->except('profile_pic', 'gender'))->save();
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
if ($user->fill($request->except('profile_pic'))->save()) {
|
||||
return redirect('guest')->with('success', 'Profile Updated sucessfully');
|
||||
}
|
||||
}
|
||||
|
||||
public function postClientProfilePassword($id, ProfilePassword $request) {
|
||||
$user = Auth::user();
|
||||
//echo $user->password;
|
||||
if (Hash::check($request->input('old_password'), $user->getAuthPassword())) {
|
||||
$user->password = Hash::make($request->input('new_password'));
|
||||
$user->save();
|
||||
return redirect()->back()->with('success', 'Password Updated sucessfully');
|
||||
} else {
|
||||
return redirect()->back()->with('fails', 'Password was not Updated');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -395,7 +395,7 @@ class InstallController extends Controller {
|
||||
File::put($install, $datacontent);
|
||||
|
||||
$smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()";
|
||||
$path22 = app_path('Http/routes.php');
|
||||
$path22 = app_path('Http\routes.php');
|
||||
$content23 = File::get($path22);
|
||||
$content23 = str_replace('"%smtplink%"', $smtpfilepath, $content23);
|
||||
File::put($path22, $content23);
|
||||
|
30
code/app/Http/Requests/kb/ArticleRequest.php
Normal file
30
code/app/Http/Requests/kb/ArticleRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ArticleRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'slug' => 'required|unique:article',
|
||||
'description' => 'required',
|
||||
'category_id' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
30
code/app/Http/Requests/kb/CategoryRequest.php
Normal file
30
code/app/Http/Requests/kb/CategoryRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class CategoryRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'slug' => 'required|unique:category',
|
||||
'description' => 'required',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
}
|
30
code/app/Http/Requests/kb/CommentRequest.php
Normal file
30
code/app/Http/Requests/kb/CommentRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class CommentRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required|max:50',
|
||||
'email' => 'required|email',
|
||||
'website' => 'url',
|
||||
'comment' => 'required|max:500',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
30
code/app/Http/Requests/kb/ContactRequest.php
Normal file
30
code/app/Http/Requests/kb/ContactRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ContactRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email',
|
||||
'subject' => 'required|max:20',
|
||||
'message' => 'required|max:60',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
29
code/app/Http/Requests/kb/FooterRequest.php
Normal file
29
code/app/Http/Requests/kb/FooterRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class FooterRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'title' => 'required',
|
||||
//'description' => 'required',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
}
|
37
code/app/Http/Requests/kb/InstallerRequest.php
Normal file
37
code/app/Http/Requests/kb/InstallerRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
/**
|
||||
* InstallerRequest
|
||||
*
|
||||
* @package Request
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class InstallerRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'firstname' => 'required|max:20',
|
||||
'Lastname' => 'required|max:20',
|
||||
'email' => 'required|max:50|email',
|
||||
'username' => 'required|max:50|min:3',
|
||||
'password' => 'required|min:6',
|
||||
'confirmpassword' => 'required|same:password',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
30
code/app/Http/Requests/kb/PageRequest.php
Normal file
30
code/app/Http/Requests/kb/PageRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class PageRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'name' => 'required',
|
||||
'slug' => 'required|unique:pages',
|
||||
//'description' => 'required',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
}
|
31
code/app/Http/Requests/kb/ProfilePassword.php
Normal file
31
code/app/Http/Requests/kb/ProfilePassword.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ProfilePassword extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'old_password' => 'required',
|
||||
'new_password' => 'required|min:6',
|
||||
'confirm_password' => 'required|same:new_password'
|
||||
];
|
||||
}
|
||||
|
||||
}
|
29
code/app/Http/Requests/kb/ProfileRequest.php
Normal file
29
code/app/Http/Requests/kb/ProfileRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class ProfileRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
'firstname' => 'required',
|
||||
'lastname' => 'required',
|
||||
'profile_pic' => 'mimes:png,jpeg',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
27
code/app/Http/Requests/kb/SearchRequest.php
Normal file
27
code/app/Http/Requests/kb/SearchRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class SearchRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
's' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
28
code/app/Http/Requests/kb/SettingsRequests.php
Normal file
28
code/app/Http/Requests/kb/SettingsRequests.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class SettingsRequests extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
// 'company_name' => 'required',
|
||||
// 'website' => 'required|url',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
42
code/app/Http/Requests/kb/SocialRequest.php
Normal file
42
code/app/Http/Requests/kb/SocialRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php namespace App\Http\Requests\kb;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class SocialRequest extends Request {
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'linkedin' =>'url',
|
||||
'stumble' =>'url',
|
||||
'google' =>'url',
|
||||
'deviantart' =>'url',
|
||||
'flickr' =>'url',
|
||||
'skype' =>'url',
|
||||
'rss' =>'url',
|
||||
'twitter' =>'url',
|
||||
'facebook' =>'url',
|
||||
'youtube' =>'url',
|
||||
'vimeo' =>'url',
|
||||
'pinterest' =>'url',
|
||||
'dribbble' =>'url',
|
||||
'instagram' =>'url'
|
||||
];
|
||||
}
|
||||
|
||||
}
|
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
"%smtplink%";
|
||||
|
||||
"%smtplink%";
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Routes
|
||||
@@ -11,15 +13,11 @@
|
||||
|
|
||||
*/
|
||||
|
||||
//Route::get('/', 'WelcomeController@index');
|
||||
//Route::get('/', 'HomeController@index');
|
||||
|
||||
Route::controllers([
|
||||
'auth' => 'Auth\AuthController',
|
||||
'password' => 'Auth\PasswordController',
|
||||
]);
|
||||
|
||||
// Route::get('login','Auth\AuthController@getLogin');
|
||||
$router->get('getmail/{token}', 'Auth\AuthController@getMail');
|
||||
|
||||
/*
|
||||
@@ -29,10 +27,6 @@ $router->get('getmail/{token}', 'Auth\AuthController@getMail');
|
||||
| Here is defining entire routes for the Admin Panel
|
||||
|
|
||||
*/
|
||||
|
||||
// To get the dash board
|
||||
//Route::get('dashboard', 'HomeController@index');
|
||||
|
||||
Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
// resource is a function to process create,edit,read and delete
|
||||
Route::resource('groups', 'Admin\helpdesk\GroupController'); // for group module, for CRUD
|
||||
@@ -65,7 +59,6 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
|
||||
Route::get('agent-profile-page/{id}',['as'=>'agent.profile.page','uses'=>'Admin\helpdesk\AgentController@agent_profile']);
|
||||
|
||||
|
||||
Route::get('getcompany', 'Admin\helpdesk\SettingsController@getcompany'); // direct to company setting page
|
||||
|
||||
Route::patch('postcompany/{id}', 'Admin\helpdesk\SettingsController@postcompany'); // Updating the Company table with requests
|
||||
@@ -94,65 +87,39 @@ Route::group(['middleware' => 'roles', 'middleware' => 'auth'], function () {
|
||||
|
||||
Route::patch('postalert/{id}', 'Admin\helpdesk\SettingsController@postalert'); // Updating the Alert table with requests
|
||||
|
||||
/* User profile edit get */
|
||||
Route::get('admin-profile', 'Admin\helpdesk\ProfileController@getProfile');
|
||||
|
||||
/* Admin profile get */
|
||||
Route::get('admin-profile-edit', 'Admin\helpdesk\ProfileController@getProfileedit');
|
||||
|
||||
/* Admin Profile Post */
|
||||
Route::patch('admin-profile', 'Admin\helpdesk\ProfileController@postProfileedit');
|
||||
|
||||
/* Admin Profile Password Post */
|
||||
Route::patch('admin-profile-password', 'Admin\helpdesk\ProfileController@postProfilePassword');
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer', 'Common\SettingsController@CreateFooter');
|
||||
Route::get('admin-profile', 'Admin\helpdesk\ProfileController@getProfile'); /* User profile edit get */
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer/{id}', 'Common\SettingsController@PostFooter');
|
||||
Route::get('admin-profile-edit', 'Admin\helpdesk\ProfileController@getProfileedit');/* Admin profile get */
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer2', 'Common\SettingsController@CreateFooter2');
|
||||
Route::patch('admin-profile', 'Admin\helpdesk\ProfileController@postProfileedit');/* Admin Profile Post */
|
||||
|
||||
Route::patch('admin-profile-password', 'Admin\helpdesk\ProfileController@postProfilePassword');/* Admin Profile Password Post */
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer2/{id}', 'Common\SettingsController@PostFooter2');
|
||||
Route::get('create-footer', 'Common\SettingsController@CreateFooter');/* get the create footer page for admin */
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer3', 'Common\SettingsController@CreateFooter3');
|
||||
Route::patch('post-create-footer/{id}', 'Common\SettingsController@PostFooter');/* post footer to insert to database */
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer3/{id}', 'Common\SettingsController@PostFooter3');
|
||||
Route::get('create-footer2', 'Common\SettingsController@CreateFooter2');/* get the create footer page for admin */
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('create-footer4', 'Common\SettingsController@CreateFooter4');
|
||||
Route::patch('post-create-footer2/{id}', 'Common\SettingsController@PostFooter2'); /* post footer to insert to database */
|
||||
|
||||
Route::get('create-footer3', 'Common\SettingsController@CreateFooter3'); /* get the create footer page for admin */
|
||||
|
||||
Route::patch('post-create-footer3/{id}', 'Common\SettingsController@PostFooter3'); /* post footer to insert to database */
|
||||
|
||||
Route::get('create-footer4', 'Common\SettingsController@CreateFooter4'); /* get the create footer page for admin */
|
||||
|
||||
Route::patch('post-create-footer4/{id}', 'Common\SettingsController@PostFooter4'); /* post footer to insert to database */
|
||||
|
||||
Route::get('getsmtp',['as'=>'getsmtp','uses'=>'Common\SettingsController@getsmtp']); /* get the create footer page for admin */
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-create-footer4/{id}', 'Common\SettingsController@PostFooter4');
|
||||
Route::patch('post-smtp',['as'=>'post_smtp','uses'=>'Common\SettingsController@postsmtp']); /* post footer to insert to database */
|
||||
|
||||
/* get the create footer page for admin */
|
||||
Route::get('getsmtp',['as'=>'getsmtp','uses'=>'Common\SettingsController@getsmtp']);
|
||||
|
||||
/* post footer to insert to database */
|
||||
Route::patch('post-smtp',['as'=>'post_smtp','uses'=>'Common\SettingsController@postsmtp']);
|
||||
Route::get('version-check',['as'=>'version-check','uses'=>'Common\SettingsController@version_check']); /* Check version */
|
||||
|
||||
/* Check version */
|
||||
Route::get('version-check',['as'=>'version-check','uses'=>'Common\SettingsController@version_check']);
|
||||
Route::post('post-version-check',['as'=>'post-version-check','uses'=>'Common\SettingsController@post_version_check']); /* post Check version */
|
||||
|
||||
/* post Check version */
|
||||
Route::post('post-version-check',['as'=>'post-version-check','uses'=>'Common\SettingsController@post_version_check']);
|
||||
|
||||
/* get Check update */
|
||||
Route::get('checkUpdate',['as'=>'checkupdate','uses'=>'Common\SettingsController@getupdate']);
|
||||
});
|
||||
/* calling ticket.blade.php file */
|
||||
|
||||
// $router->get('tickets','Admin\ThreadController@getTickets');
|
||||
|
||||
/* calling timeline.blade.php file */
|
||||
|
||||
Route::get('time', function () {
|
||||
return view('themes.default1.admin.tickets.timeline');
|
||||
Route::get('checkUpdate',['as'=>'checkupdate','uses'=>'Common\SettingsController@getupdate']); /* get Check update */
|
||||
});
|
||||
|
||||
/*
|
||||
@@ -164,132 +131,90 @@ Route::get('time', function () {
|
||||
|
|
||||
*/
|
||||
Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function () {
|
||||
/* User router is used to control the CRUD of user */
|
||||
Route::resource('user', 'Agent\helpdesk\UserController');
|
||||
|
||||
/* organization router used to deal CRUD function of organization */
|
||||
Route::resource('organizations', 'Agent\helpdesk\OrganizationController');
|
||||
Route::resource('user', 'Agent\helpdesk\UserController'); /* User router is used to control the CRUD of user */
|
||||
|
||||
/* User profile get */
|
||||
Route::get('profile',['as'=>'profile' , 'uses'=> 'Agent\helpdesk\UserController@getProfile']);
|
||||
Route::resource('organizations', 'Agent\helpdesk\OrganizationController'); /* organization router used to deal CRUD function of organization */
|
||||
|
||||
/* User profile edit get */
|
||||
Route::get('profile-edit', ['as'=>'agent-profile-edit','uses'=>'Agent\helpdesk\UserController@getProfileedit']);
|
||||
Route::get('profile',['as'=>'profile' , 'uses'=> 'Agent\helpdesk\UserController@getProfile']); /* User profile get */
|
||||
|
||||
/* User Profile Post */
|
||||
Route::patch('agent-profile',['as'=>'agent-profile','uses'=> 'Agent\helpdesk\UserController@postProfileedit']);
|
||||
Route::get('profile-edit', ['as'=>'agent-profile-edit','uses'=>'Agent\helpdesk\UserController@getProfileedit']); /* User profile edit get */
|
||||
|
||||
/* Profile Password Post */
|
||||
Route::patch('agent-profile-password/{id}', 'Agent\helpdesk\UserController@postProfilePassword');
|
||||
Route::patch('agent-profile',['as'=>'agent-profile','uses'=> 'Agent\helpdesk\UserController@postProfileedit']); /* User Profile Post */
|
||||
|
||||
/* Canned list */
|
||||
Route::get('canned/list',['as'=>'canned.list','uses'=>'Agent\helpdesk\CannedController@index']);
|
||||
Route::patch('agent-profile-password/{id}', 'Agent\helpdesk\UserController@postProfilePassword'); /* Profile Password Post */
|
||||
|
||||
/* Canned create */
|
||||
Route::get('canned/create',['as'=>'canned.create','uses'=>'Agent\helpdesk\CannedController@create']);
|
||||
Route::get('canned/list',['as'=>'canned.list','uses'=>'Agent\helpdesk\CannedController@index']); /* Canned list */
|
||||
|
||||
/* Canned store */
|
||||
Route::patch('canned/store',['as'=>'canned.store','uses'=>'Agent\helpdesk\CannedController@store']);
|
||||
Route::get('canned/create',['as'=>'canned.create','uses'=>'Agent\helpdesk\CannedController@create']); /* Canned create */
|
||||
|
||||
/* Canned edit */
|
||||
Route::get('canned/edit/{id}',['as'=>'canned.edit','uses'=>'Agent\helpdesk\CannedController@edit']);
|
||||
Route::patch('canned/store',['as'=>'canned.store','uses'=>'Agent\helpdesk\CannedController@store']); /* Canned store */
|
||||
|
||||
/* Canned update */
|
||||
Route::patch('canned/update/{id}',['as'=>'canned.update','uses'=>'Agent\helpdesk\CannedController@update']);
|
||||
Route::get('canned/edit/{id}',['as'=>'canned.edit','uses'=>'Agent\helpdesk\CannedController@edit']); /* Canned edit */
|
||||
|
||||
/* Canned show */
|
||||
Route::get('canned/show/{id}',['as'=>'canned.show','uses'=>'Agent\helpdesk\CannedController@show']);
|
||||
Route::patch('canned/update/{id}',['as'=>'canned.update','uses'=>'Agent\helpdesk\CannedController@update']); /* Canned update */
|
||||
|
||||
/* Canned delete */
|
||||
Route::delete('canned/destroy/{id}',['as'=>'canned.destroy','uses'=>'Agent\helpdesk\CannedController@destroy']);
|
||||
Route::get('canned/show/{id}',['as'=>'canned.show','uses'=>'Agent\helpdesk\CannedController@show']); /* Canned show */
|
||||
|
||||
// Route::get('/abcd', 'GuestController@getList');
|
||||
// Route::get('/qwer', ['as' => 'thread', 'uses' => 'GuestController@getThread']);
|
||||
Route::delete('canned/destroy/{id}',['as'=>'canned.destroy','uses'=>'Agent\helpdesk\CannedController@destroy']); /* Canned delete */
|
||||
|
||||
/* Fetch Emails */
|
||||
Route::get('/test', ['as' => 'thr', 'uses' => 'Agent\helpdesk\MailController@fetchdata']);
|
||||
Route::get('/test', ['as' => 'thr', 'uses' => 'Agent\helpdesk\MailController@fetchdata']); /* Fetch Emails */
|
||||
|
||||
/* Get Ticket */
|
||||
Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']);
|
||||
Route::get('/ticket', ['as' => 'ticket', 'uses' => 'Agent\helpdesk\TicketController@ticket_list']); /* Get Ticket */
|
||||
|
||||
/* Get Inbox Ticket */
|
||||
Route::get('/ticket/inbox', ['as' => 'inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@inbox_ticket_list']);
|
||||
Route::get('/ticket/inbox', ['as' => 'inbox.ticket', 'uses' => 'Agent\helpdesk\TicketController@inbox_ticket_list']); /* Get Inbox Ticket */
|
||||
|
||||
/* Get Open Ticket */
|
||||
Route::get('/ticket/open', ['as' => 'open.ticket', 'uses' => 'Agent\helpdesk\TicketController@open_ticket_list']);
|
||||
Route::get('/ticket/open', ['as' => 'open.ticket', 'uses' => 'Agent\helpdesk\TicketController@open_ticket_list']); /* Get Open Ticket */
|
||||
|
||||
/* Get Answered Ticket */
|
||||
Route::get('/ticket/answered', ['as' => 'answered.ticket', 'uses' => 'Agent\helpdesk\TicketController@answered_ticket_list']);
|
||||
Route::get('/ticket/answered', ['as' => 'answered.ticket', 'uses' => 'Agent\helpdesk\TicketController@answered_ticket_list']); /* Get Answered Ticket */
|
||||
|
||||
/* Get Tickets Assigned to logged user */
|
||||
Route::get('/ticket/myticket', ['as' => 'myticket.ticket', 'uses' => 'Agent\helpdesk\TicketController@myticket_ticket_list']);
|
||||
Route::get('/ticket/myticket', ['as' => 'myticket.ticket', 'uses' => 'Agent\helpdesk\TicketController@myticket_ticket_list']); /* Get Tickets Assigned to logged user */
|
||||
|
||||
/* Get Overdue Ticket */
|
||||
Route::get('/ticket/overdue', ['as' => 'overdue.ticket', 'uses' => 'Agent\helpdesk\TicketController@overdue_ticket_list']);
|
||||
Route::get('/ticket/overdue', ['as' => 'overdue.ticket', 'uses' => 'Agent\helpdesk\TicketController@overdue_ticket_list']); /* Get Overdue Ticket */
|
||||
|
||||
/* Get Closed Ticket */
|
||||
Route::get('/ticket/closed', ['as' => 'closed.ticket', 'uses' => 'Agent\helpdesk\TicketController@closed_ticket_list']);
|
||||
Route::get('/ticket/closed', ['as' => 'closed.ticket', 'uses' => 'Agent\helpdesk\TicketController@closed_ticket_list']); /* Get Closed Ticket */
|
||||
|
||||
/* Get Assigned Ticket */
|
||||
Route::get('/ticket/assigned', ['as' => 'assigned.ticket', 'uses' => 'Agent\helpdesk\TicketController@assigned_ticket_list']);
|
||||
Route::get('/ticket/assigned', ['as' => 'assigned.ticket', 'uses' => 'Agent\helpdesk\TicketController@assigned_ticket_list']); /* Get Assigned Ticket */
|
||||
|
||||
/* Get Create New Ticket */
|
||||
Route::get('/newticket', ['as' => 'newticket', 'uses' => 'Agent\helpdesk\TicketController@newticket']);
|
||||
Route::get('/newticket', ['as' => 'newticket', 'uses' => 'Agent\helpdesk\TicketController@newticket']); /* Get Create New Ticket */
|
||||
|
||||
/* Post Create New Ticket */
|
||||
Route::post('/newticket/post', ['as' => 'post.newticket', 'uses' => 'Agent\helpdesk\TicketController@post_newticket']);
|
||||
Route::post('/newticket/post', ['as' => 'post.newticket', 'uses' => 'Agent\helpdesk\TicketController@post_newticket']); /* Post Create New Ticket */
|
||||
|
||||
/* Get Thread by ID */
|
||||
Route::get('/thread/{id}', ['as' => 'ticket.thread', 'uses' => 'Agent\helpdesk\TicketController@thread']);
|
||||
Route::get('/thread/{id}', ['as' => 'ticket.thread', 'uses' => 'Agent\helpdesk\TicketController@thread']); /* Get Thread by ID */
|
||||
|
||||
/* Patch Thread Reply */
|
||||
Route::patch('/thread/reply/{id}', ['as' => 'ticket.reply', 'uses' => 'Agent\helpdesk\TicketController@reply']);
|
||||
Route::patch('/thread/reply/{id}', ['as' => 'ticket.reply', 'uses' => 'Agent\helpdesk\TicketController@reply']); /* Patch Thread Reply */
|
||||
|
||||
/* Patch Internal Note */
|
||||
Route::patch('/internal/note/{id}', ['as' => 'Internal.note', 'uses' => 'Agent\helpdesk\TicketController@InternalNote']);
|
||||
Route::patch('/internal/note/{id}', ['as' => 'Internal.note', 'uses' => 'Agent\helpdesk\TicketController@InternalNote']); /* Patch Internal Note */
|
||||
|
||||
/* Patch Ticket assigned to whom */
|
||||
Route::patch('/ticket/assign/{id}', ['as' => 'assign.ticket', 'uses' => 'Agent\helpdesk\TicketController@assign']);
|
||||
Route::patch('/ticket/assign/{id}', ['as' => 'assign.ticket', 'uses' => 'Agent\helpdesk\TicketController@assign']); /* Patch Ticket assigned to whom */
|
||||
|
||||
/* Patchi Ticket Edit */
|
||||
Route::patch('/ticket/post/edit/{id}', ['as' => 'ticket.post.edit', 'uses' => 'Agent\helpdesk\TicketController@ticket_edit_post']);
|
||||
Route::patch('/ticket/post/edit/{id}', ['as' => 'ticket.post.edit', 'uses' => 'Agent\helpdesk\TicketController@ticket_edit_post']); /* Patchi Ticket Edit */
|
||||
|
||||
/* Get Print Ticket */
|
||||
Route::get('/ticket/print/{id}', ['as' => 'ticket.print', 'uses' => 'Agent\helpdesk\TicketController@ticket_print']);
|
||||
Route::get('/ticket/print/{id}', ['as' => 'ticket.print', 'uses' => 'Agent\helpdesk\TicketController@ticket_print']); /* Get Print Ticket */
|
||||
|
||||
/* Get Ticket Close */
|
||||
Route::get('/ticket/close/{id}', ['as' => 'ticket.close', 'uses' => 'Agent\helpdesk\TicketController@close']);
|
||||
Route::get('/ticket/close/{id}', ['as' => 'ticket.close', 'uses' => 'Agent\helpdesk\TicketController@close']); /* Get Ticket Close */
|
||||
|
||||
/* Get ticket Resolve */
|
||||
Route::get('/ticket/resolve/{id}', ['as' => 'ticket.resolve', 'uses' => 'Agent\helpdesk\TicketController@resolve']);
|
||||
Route::get('/ticket/resolve/{id}', ['as' => 'ticket.resolve', 'uses' => 'Agent\helpdesk\TicketController@resolve']); /* Get ticket Resolve */
|
||||
|
||||
/* Get Ticket Open */
|
||||
Route::get('/ticket/open/{id}', ['as' => 'ticket.open', 'uses' => 'Agent\helpdesk\TicketController@open']);
|
||||
Route::get('/ticket/open/{id}', ['as' => 'ticket.open', 'uses' => 'Agent\helpdesk\TicketController@open']); /* Get Ticket Open */
|
||||
|
||||
/* Get Ticket Delete */
|
||||
Route::get('/ticket/delete/{id}', ['as' => 'ticket.delete', 'uses' => 'Agent\helpdesk\TicketController@delete']);
|
||||
Route::get('/ticket/delete/{id}', ['as' => 'ticket.delete', 'uses' => 'Agent\helpdesk\TicketController@delete']); /* Get Ticket Delete */
|
||||
|
||||
/* Get Ban Email */
|
||||
Route::get('/email/ban/{id}', ['as' => 'ban.email', 'uses' => 'Agent\helpdesk\TicketController@ban']);
|
||||
Route::get('/email/ban/{id}', ['as' => 'ban.email', 'uses' => 'Agent\helpdesk\TicketController@ban']); /* Get Ban Email */
|
||||
|
||||
/* Get Ticket Surrender */
|
||||
Route::get('/ticket/surrender/{id}', ['as' => 'ticket.surrender', 'uses' => 'Agent\helpdesk\TicketController@surrender']);
|
||||
Route::get('/ticket/surrender/{id}', ['as' => 'ticket.surrender', 'uses' => 'Agent\helpdesk\TicketController@surrender']); /* Get Ticket Surrender */
|
||||
|
||||
Route::get('/aaaa', 'Client\helpdesk\GuestController@ticket_number');
|
||||
|
||||
/* To show Deleted Tickets */
|
||||
Route::get('trash', 'Agent\helpdesk\TicketController@trash');
|
||||
Route::get('trash', 'Agent\helpdesk\TicketController@trash'); /* To show Deleted Tickets */
|
||||
|
||||
/* To show Unassigned Tickets */
|
||||
Route::get('unassigned', 'Agent\helpdesk\TicketController@unassigned');
|
||||
Route::get('unassigned', 'Agent\helpdesk\TicketController@unassigned'); /* To show Unassigned Tickets */
|
||||
|
||||
/* To show dashboard pages */
|
||||
Route::get('dashboard', 'Agent\helpdesk\DashboardController@index');
|
||||
Route::get('dashboard', 'Agent\helpdesk\DashboardController@index'); /* To show dashboard pages */
|
||||
|
||||
Route::get('agen', 'Agent\helpdesk\DashboardController@ChartData');
|
||||
|
||||
/* get image */
|
||||
Route::get('image/{id}', ['as'=>'image', 'uses'=>'Agent\helpdesk\MailController@get_data']);
|
||||
Route::get('agen', 'Agent\helpdesk\DashboardController@ChartData');
|
||||
|
||||
Route::get('image/{id}', ['as'=>'image', 'uses'=>'Agent\helpdesk\MailController@get_data']); /* get image */
|
||||
|
||||
Route::get('thread/auto/{id}', 'Agent\helpdesk\TicketController@autosearch');
|
||||
|
||||
@@ -316,15 +241,15 @@ Route::group(['middleware' => 'role.agent', 'middleware' => 'auth'], function ()
|
||||
Route::patch('/head-org/{id}','Agent\helpdesk\OrganizationController@Head_Org');
|
||||
|
||||
// Department ticket
|
||||
// Open
|
||||
Route::get('/{dept}/open',['as'=>'dept.open.ticket','uses'=>'Agent\helpdesk\TicketController@deptopen']);
|
||||
// Inprogress
|
||||
Route::get('/{dept}/inprogress',['as'=>'dept.inprogress.ticket','uses'=>'Agent\helpdesk\TicketController@deptinprogress']);
|
||||
// Closed
|
||||
Route::get('/{dept}/closed',['as'=>'dept.closed.ticket','uses'=>'Agent\helpdesk\TicketController@deptclose']);
|
||||
|
||||
Route::get('/{dept}/open',['as'=>'dept.open.ticket','uses'=>'Agent\helpdesk\TicketController@deptopen']); // Open
|
||||
|
||||
Route::get('/{dept}/inprogress',['as'=>'dept.inprogress.ticket','uses'=>'Agent\helpdesk\TicketController@deptinprogress']); // Inprogress
|
||||
|
||||
Route::get('/{dept}/closed',['as'=>'dept.closed.ticket','uses'=>'Agent\helpdesk\TicketController@deptclose']); // Closed
|
||||
|
||||
});
|
||||
// cscdds
|
||||
|
||||
/*
|
||||
|------------------------------------------------------------------
|
||||
|Guest Routes
|
||||
@@ -352,169 +277,244 @@ Route::any('getdata', function() {
|
||||
}
|
||||
});
|
||||
|
||||
/* get the form for create a ticket by guest user */
|
||||
Route::get('getform', ['as'=>'guest.getform' ,'uses'=> 'Client\helpdesk\FormController@getForm']);
|
||||
/* post the AJAX form for create a ticket by guest user */
|
||||
Route::post('postform/{id}', 'Client\helpdesk\FormController@postForm');
|
||||
/* post the form to store the value */
|
||||
Route::post('postedform', 'Client\helpdesk\FormController@postedForm');
|
||||
//testing checkbox auto-populate
|
||||
Route::get('check', 'CheckController@getcheck');
|
||||
|
||||
Route::get('getform', ['as'=>'guest.getform' ,'uses'=> 'Client\helpdesk\FormController@getForm']); /* get the form for create a ticket by guest user */
|
||||
|
||||
Route::post('postform/{id}', 'Client\helpdesk\FormController@postForm'); /* post the AJAX form for create a ticket by guest user */
|
||||
|
||||
Route::post('postedform', 'Client\helpdesk\FormController@postedForm'); /* post the form to store the value */
|
||||
|
||||
Route::get('check', 'CheckController@getcheck'); //testing checkbox auto-populate
|
||||
|
||||
Route::post('postcheck/{id}', 'CheckController@postcheck');
|
||||
//guest layout
|
||||
Route::get('home', ['as'=>'home', 'uses'=>'Client\helpdesk\WelcomepageController@index']);
|
||||
|
||||
Route::get('home', ['as'=>'home', 'uses'=>'Client\helpdesk\WelcomepageController@index']); //guest layout
|
||||
|
||||
Route::get('/', ['as'=>'/', 'uses'=>'Client\helpdesk\WelcomepageController@index']);
|
||||
|
||||
//getform
|
||||
Route::get('form',['as'=>'form','uses'=>'Client\helpdesk\FormController@getForm']);
|
||||
//detail ticket information
|
||||
Route::get('mytickets/{id}', ['as' => 'ticketinfo', 'uses' => 'Client\helpdesk\GuestController@singleThread']);
|
||||
//ticket ckeck
|
||||
Route::post('checkmyticket', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
//detail ticket information
|
||||
Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']);
|
||||
Route::get('form',['as'=>'form','uses'=>'Client\helpdesk\FormController@getForm']); //getform
|
||||
|
||||
Route::get('mytickets/{id}', ['as' => 'ticketinfo', 'uses' => 'Client\helpdesk\GuestController@singleThread']); //detail ticket information
|
||||
|
||||
Route::post('checkmyticket', 'Client\helpdesk\GuestController@PostCheckTicket'); //ticket ckeck
|
||||
|
||||
Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']); //detail ticket information
|
||||
|
||||
//testing ckeditor
|
||||
//===================================================================================
|
||||
Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function () {
|
||||
/* User profile get */
|
||||
Route::get('client-profile', ['as'=>'client.profile', 'uses'=>'Client\helpdesk\GuestController@getProfile']);
|
||||
|
||||
Route::get('client-profile', ['as'=>'client.profile', 'uses'=>'Client\helpdesk\GuestController@getProfile']); /* User profile get */
|
||||
|
||||
Route::get('mytickets', ['as' => 'ticket2', 'uses' => 'Client\helpdesk\GuestController@getMyticket']);
|
||||
/* Get my tickets */
|
||||
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']);
|
||||
/* User Profile Post */
|
||||
Route::patch('client-profile-edit', 'Client\helpdesk\GuestController@postProfile');
|
||||
/* Profile Password Post */
|
||||
Route::patch('client-profile-password', 'Client\helpdesk\GuestController@postProfilePassword');
|
||||
|
||||
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']); /* Get my tickets */
|
||||
|
||||
Route::patch('client-profile-edit', 'Client\helpdesk\GuestController@postProfile'); /* User Profile Post */
|
||||
|
||||
Route::patch('client-profile-password', 'Client\helpdesk\GuestController@postProfilePassword'); /* Profile Password Post */
|
||||
|
||||
Route::post('post/reply/{id}',['as'=>'client.reply','uses'=>'Client\helpdesk\ClientTicketController@reply']);
|
||||
|
||||
});
|
||||
|
||||
//====================================================================================
|
||||
/* Check your Ticket */
|
||||
Route::get('checkticket', 'Client\helpdesk\ClientTicketController@getCheckTicket');
|
||||
/* Get my tickets */
|
||||
Route::get('myticket', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@getMyticket']);
|
||||
/* Get my tickets */
|
||||
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']);
|
||||
/* post Check Ticket */
|
||||
Route::post('postcheck', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
Route::get('postcheck', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
|
||||
Route::post('post-ticket-reply/{id}', 'Client\helpdesk\FormController@post_ticket_reply');
|
||||
Route::get('checkticket', 'Client\helpdesk\ClientTicketController@getCheckTicket'); /* Check your Ticket */
|
||||
|
||||
Route::get('myticket', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@getMyticket']);/* Get my tickets */
|
||||
|
||||
Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']);/* Get my tickets */
|
||||
|
||||
Route::post('postcheck', 'Client\helpdesk\GuestController@PostCheckTicket');/* post Check Ticket */
|
||||
|
||||
Route::get('postcheck', 'Client\helpdesk\GuestController@PostCheckTicket');
|
||||
|
||||
Route::post('post-ticket-reply/{id}', 'Client\helpdesk\FormController@post_ticket_reply');
|
||||
|
||||
|
||||
/* 404 page */
|
||||
Route::get('404', 'error\ErrorController@error404');
|
||||
// Route::get('404', 'error\ErrorController@error404');
|
||||
|
||||
// installer
|
||||
Route::get('/serial', array(
|
||||
'as' => 'serialkey',
|
||||
'uses' => 'Installer\helpdesk\InstallController@serialkey',
|
||||
));
|
||||
Route::post('/CheckSerial/{id}', array(
|
||||
'as' => 'CheckSerial',
|
||||
'uses' => 'Installer\helpdesk\InstallController@PostSerialKey',
|
||||
));
|
||||
Route::get('/step1', array(
|
||||
'as' => 'licence',
|
||||
'uses' => 'Installer\helpdesk\InstallController@licence',
|
||||
));
|
||||
Route::post('/step1post', array(
|
||||
'as' => 'postlicence',
|
||||
'uses' => 'Installer\helpdesk\InstallController@licencecheck',
|
||||
));
|
||||
Route::get('/step2', array(
|
||||
'as' => 'prerequisites',
|
||||
'uses' => 'Installer\helpdesk\InstallController@prerequisites',
|
||||
));
|
||||
Route::post('/step2post', array(
|
||||
'as' => 'postprerequisites',
|
||||
'uses' => 'Installer\helpdesk\InstallController@prerequisitescheck',
|
||||
));
|
||||
Route::get('/step3', array(
|
||||
'as' => 'localization',
|
||||
'uses' => 'Installer\helpdesk\InstallController@localization',
|
||||
));
|
||||
Route::post('/step3post', array(
|
||||
'as' => 'postlocalization',
|
||||
'uses' => 'Installer\helpdesk\InstallController@localizationcheck',
|
||||
));
|
||||
Route::get('/step4', array(
|
||||
'as' => 'configuration',
|
||||
'uses' => 'Installer\helpdesk\InstallController@configuration',
|
||||
));
|
||||
Route::post('/step4post', array(
|
||||
'as' => 'postconfiguration',
|
||||
'uses' => 'Installer\helpdesk\InstallController@configurationcheck',
|
||||
));
|
||||
Route::get('/step5', array(
|
||||
'as' => 'database',
|
||||
'uses' => 'Installer\helpdesk\InstallController@database',
|
||||
));
|
||||
Route::get('/step6', array(
|
||||
'as' => 'account',
|
||||
'uses' => 'Installer\helpdesk\InstallController@account',
|
||||
));
|
||||
Route::post('/step6post', array(
|
||||
'as' => 'postaccount',
|
||||
'uses' => 'Installer\helpdesk\InstallController@accountcheck',
|
||||
));
|
||||
Route::get('/final', array(
|
||||
'as' => 'final',
|
||||
'uses' => 'Installer\helpdesk\InstallController@finalize',
|
||||
));
|
||||
Route::post('/finalpost', array(
|
||||
'as' => 'postfinal',
|
||||
'uses' => 'Installer\helpdesk\InstallController@finalcheck',
|
||||
));
|
||||
Route::patch('/postconnection', array(
|
||||
'as' => 'postconnection',
|
||||
'uses' => 'Installer\helpdesk\InstallController@postconnection',
|
||||
));
|
||||
/*
|
||||
|============================================================
|
||||
| Installer Routes
|
||||
|============================================================
|
||||
| These routes are for installer
|
||||
|
|
||||
*/
|
||||
Route::get('/serial', ['as' => 'serialkey' ,'uses' => 'Installer\helpdesk\InstallController@serialkey']);
|
||||
Route::post('/CheckSerial/{id}', ['as' => 'CheckSerial', 'uses' => 'Installer\helpdesk\InstallController@PostSerialKey']);
|
||||
Route::get('/step1', ['as' => 'licence', 'uses' => 'Installer\helpdesk\InstallController@licence']);
|
||||
Route::post('/step1post', ['as' => 'postlicence', 'uses' => 'Installer\helpdesk\InstallController@licencecheck']);
|
||||
Route::get('/step2', ['as' => 'prerequisites', 'uses' => 'Installer\helpdesk\InstallController@prerequisites']);
|
||||
Route::post('/step2post', ['as' => 'postprerequisites', 'uses' => 'Installer\helpdesk\InstallController@prerequisitescheck']);
|
||||
Route::get('/step3', ['as' => 'localization', 'uses' => 'Installer\helpdesk\InstallController@localization']);
|
||||
Route::post('/step3post', ['as' => 'postlocalization', 'uses' => 'Installer\helpdesk\InstallController@localizationcheck']);
|
||||
Route::get('/step4', ['as' => 'configuration', 'uses' => 'Installer\helpdesk\InstallController@configuration']);
|
||||
Route::post('/step4post', ['as' => 'postconfiguration','uses' => 'Installer\helpdesk\InstallController@configurationcheck']);
|
||||
Route::get('/step5', ['as' => 'database', 'uses' => 'Installer\helpdesk\InstallController@database']);
|
||||
Route::get('/step6', ['as' => 'account','uses' => 'Installer\helpdesk\InstallController@account']);
|
||||
Route::post('/step6post', ['as' => 'postaccount', 'uses' => 'Installer\helpdesk\InstallController@accountcheck']);
|
||||
Route::get('/final', ['as' => 'final','uses' => 'Installer\helpdesk\InstallController@finalize']);
|
||||
Route::post('/finalpost', ['as' => 'postfinal','uses' => 'Installer\helpdesk\InstallController@finalcheck']);
|
||||
Route::patch('/postconnection', ['as' => 'postconnection','uses' => 'Installer\helpdesk\InstallController@postconnection']);
|
||||
|
||||
|
||||
|
||||
// cron job link
|
||||
/*
|
||||
|=============================================================
|
||||
| Cron Job links
|
||||
|=============================================================
|
||||
| These links are for cron job execution
|
||||
|
|
||||
*/
|
||||
Route::get('readmails',['as' => 'readmails', 'uses' => 'Agent\helpdesk\MailController@readmails']);
|
||||
|
||||
// to list of routes
|
||||
Route::get('/aaa',function(){
|
||||
$routeCollection = Route::getRoutes();
|
||||
echo "<table style='width:100%'>";
|
||||
echo "<tr>";
|
||||
echo "<td width='10%'><h4>HTTP Method</h4></td>";
|
||||
echo "<td width='10%'><h4>Route</h4></td>";
|
||||
echo "<td width='10%'><h4>Url</h4></td>";
|
||||
echo "<td width='80%'><h4>Corresponding Action</h4></td>";
|
||||
echo "</tr>";
|
||||
foreach ($routeCollection as $value) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $value->getMethods()[0] . "</td>";
|
||||
echo "<td>" . $value->getName() . "</td>";
|
||||
echo "<td>" . $value->getPath() . "</td>";
|
||||
echo "<td>" . $value->getActionName() . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
});
|
||||
|
||||
Route::get('503',function(){
|
||||
return view('errors.503');
|
||||
});
|
||||
/*
|
||||
|=============================================================
|
||||
| View all the Routes
|
||||
|=============================================================
|
||||
*/
|
||||
Route::get('/aaa',function(){
|
||||
$routeCollection = Route::getRoutes();
|
||||
echo "<table style='width:100%'>";
|
||||
echo "<tr>";
|
||||
echo "<td width='10%'><h4>HTTP Method</h4></td>";
|
||||
echo "<td width='10%'><h4>Route</h4></td>";
|
||||
echo "<td width='10%'><h4>Url</h4></td>";
|
||||
echo "<td width='80%'><h4>Corresponding Action</h4></td>";
|
||||
echo "</tr>";
|
||||
foreach ($routeCollection as $value) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . $value->getMethods()[0] . "</td>";
|
||||
echo "<td>" . $value->getName() . "</td>";
|
||||
echo "<td>" . $value->getPath() . "</td>";
|
||||
echo "<td>" . $value->getActionName() . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
});
|
||||
|
||||
Route::get('404',function(){
|
||||
return view('errors.404');
|
||||
});
|
||||
/*
|
||||
|=============================================================
|
||||
| Error Routes
|
||||
|=============================================================
|
||||
*/
|
||||
Route::get('503',function(){ return view('errors.503');});
|
||||
Route::get('404',function(){return view('errors.404');});
|
||||
|
||||
|
||||
Route::get('testmail',function(){
|
||||
$e = "hello";
|
||||
Config::set('mail.host', 'smtp.gmail.com');
|
||||
/*
|
||||
|=============================================================
|
||||
| Test mail Routes
|
||||
|=============================================================
|
||||
*/
|
||||
Route::get('testmail',function(){
|
||||
$e = "hello";
|
||||
Config::set('mail.host', 'smtp.gmail.com');
|
||||
\Mail::send('errors.report', array('e' => $e), function ($message) {
|
||||
$message->to('sujitprasad4567@gmail.com', 'sujit prasad')->subject('Error');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/* For the crud of catogory */
|
||||
$router->resource('category', 'Agent\kb\CategoryController');
|
||||
$router->get('category/delete/{id}', 'Agent\kb\CategoryController@destroy');
|
||||
/* For the crud of article */
|
||||
$router->resource('article', 'Agent\kb\ArticleController');
|
||||
$router->get('article/delete/{id}', 'Agent\kb\ArticleController@destroy');
|
||||
/* get settings */
|
||||
$router->get('settings', ['as'=>'settings' , 'uses'=> 'Agent\kb\SettingsController@settings']);
|
||||
/* post settings */
|
||||
$router->patch('postsettings/{id}', 'Agent\kb\SettingsController@postSettings');
|
||||
/* get the create faq page */
|
||||
$router->get('create-faq',['as'=>'create-faq' , 'uses'=> 'Agent\kb\SettingsController@Faq'] );
|
||||
/* post faq */
|
||||
$router->patch('post-create-faq/{id}', 'Agent\kb\SettingsController@postfaq');
|
||||
/* get the create page for Social- link */
|
||||
$router->get('social',['as'=>'social' , 'uses'=> 'Agent\kb\SettingsController@CreateSocialLink']);
|
||||
/* post Social - link for insert to database */
|
||||
$router->patch('postsocial',['as'=>'post-create-social' , 'uses'=> 'Agent\kb\SettingsController@PostSocial']);
|
||||
//Route for administrater to access the comment
|
||||
$router->get('comment',['as'=>'comment' , 'uses'=> 'Agent\kb\SettingsController@comment']);
|
||||
/* Route to define the comment should Published */
|
||||
$router->get('published/{id}',['as'=>'published' , 'uses'=> 'Agent\kb\SettingsController@publish']);
|
||||
/* Route for deleting comments */
|
||||
$router->delete('deleted/{id}', ['as'=>'deleted' , 'uses'=>'Agent\kb\SettingsController@delete']);
|
||||
/* Route for Profile */
|
||||
// $router->get('profile', ['as' => 'profile', 'uses' => 'Agent\kb\SettingsController@getProfile']);
|
||||
/* Profile Update */
|
||||
// $router->patch('post-profile', ['as' => 'post-profile', 'uses' =>'Agent\kb\SettingsController@postProfile'] );
|
||||
/* Profile password Update */
|
||||
// $router->patch('post-profile-password/{id}',['as' => 'post-profile-password', 'uses' => 'Agent\kb\SettingsController@postProfilepassword']);
|
||||
/* delete Logo */
|
||||
$router->get('delete-logo/{id}',['as' => 'delete-logo', 'uses' => 'Agent\kb\SettingsController@deleteLogo']);
|
||||
/* delete Background */
|
||||
$router->get('delete-background/{id}',['as' => 'delete-background', 'uses' => 'Agent\kb\SettingsController@deleteBackground']);
|
||||
$router->resource('page', 'Agent\kb\PageController');
|
||||
$router->get('get-pages', ['as' => 'api.page', 'uses' => 'Agent\kb\PageController@getData']);
|
||||
$router->get('page/delete/{id}',['as' => 'pagedelete', 'uses' =>'Agent\kb\PageController@destroy'] );
|
||||
$router->get('comment/delete/{id}',['as' => 'commentdelete', 'uses' => 'Agent\kb\SettingsController@delete']);
|
||||
$router->get('get-articles', ['as' => 'api.article', 'uses' => 'Agent\kb\ArticleController@getData']);
|
||||
$router->get('get-categorys', ['as' => 'api.category', 'uses' => 'Agent\kb\CategoryController@getData']);
|
||||
$router->get('get-comment', ['as' => 'api.comment', 'uses' => 'Agent\kb\SettingsController@getData']);
|
||||
$router->get('test', 'ArticleController@test');
|
||||
|
||||
$router->get('side1', 'Agent\kb\SettingsController@side1');
|
||||
$router->patch('side1/{id}', 'Agent\kb\SettingsController@postside1');
|
||||
|
||||
$router->get('side2', 'Agent\kb\SettingsController@side2');
|
||||
$router->patch('side2/{id}', 'Agent\kb\SettingsController@postside2');
|
||||
$router->post('image', 'Agent\kb\SettingsController@image');
|
||||
|
||||
$router->get('direct', function () {
|
||||
return view('direct');
|
||||
});
|
||||
|
||||
|
||||
// Route::get('smp','HomeController@getsmtp');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Route::get('/',['as'=>'home' , 'uses'=> 'client\kb\UserController@home'] );
|
||||
/* post the comment from show page */
|
||||
$router->post('postcomment/{slug}',['as'=>'postcomment' , 'uses'=> 'client\kb\UserController@postComment']);
|
||||
/* get the article list */
|
||||
$router->get('article-list',['as'=>'article-list' , 'uses'=> 'client\kb\UserController@getArticle']);
|
||||
// /* get search values */
|
||||
$router->get('search',['as'=>'search', 'uses'=> 'client\kb\UserController@search']);
|
||||
/* get the selected article */
|
||||
$router->get('show/{slug}',['as'=>'show' , 'uses'=> 'client\kb\UserController@show']);
|
||||
$router->get('category-list', ['as'=>'category-list' , 'uses'=> 'client\kb\UserController@getCategoryList']);
|
||||
/* get the categories with article */
|
||||
$router->get('category-list/{id}',['as'=>'categorylist' , 'uses'=>'client\kb\UserController@getCategory']);
|
||||
/* get the home page */
|
||||
$router->get('home',['as'=>'home' , 'uses'=> 'client\kb\UserController@home']);
|
||||
/* get the faq value to user */
|
||||
$router->get('faq',['as'=>'faq' , 'uses'=>'client\kb\UserController@Faq'] );
|
||||
/* get the cantact page to user */
|
||||
$router->get('contact',['as'=>'contact' , 'uses'=> 'client\kb\UserController@contact']);
|
||||
/* post the cantact page to controller */
|
||||
$router->post('post-contact',['as'=>'post-contact' , 'uses'=> 'client\kb\UserController@postContact']);
|
||||
//to get the value for page content
|
||||
$router->get('pages/{name}', ['as' => 'pages', 'uses' =>'client\kb\UserController@getPage']);
|
||||
//profile
|
||||
$router->get('client-profile',['as' => 'client-profile', 'uses' => 'client\kb\UserController@clientProfile']);
|
||||
Route::patch('client-profile-edit',['as' => 'client-profile-edit', 'uses' => 'client\kb\UserController@postClientProfile']);
|
||||
Route::patch('client-profile-password/{id}',['as' => 'client-profile-password', 'uses' => 'client\kb\UserController@postClientProfilePassword']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Route::get('/inbox/data', ['as' => 'api.inbox', 'uses' => 'Agent\helpdesk\TicketController@get_inbox']);
|
||||
|
||||
|
27
code/app/Model/kb/Article.php
Normal file
27
code/app/Model/kb/Article.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php namespace App\Model\kb;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Nicolaslopezj\Searchable\SearchableTrait;
|
||||
|
||||
class Article extends Model {
|
||||
use SearchableTrait;
|
||||
|
||||
/**
|
||||
* Searchable rules.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $searchable = [
|
||||
'columns' => [
|
||||
'name' => 10,
|
||||
'slug' => 10,
|
||||
'description' => 10,
|
||||
|
||||
],
|
||||
];
|
||||
|
||||
/* define the table name to get the properties of article model as protected */
|
||||
protected $table = 'article';
|
||||
/* define the fillable field in the table */
|
||||
protected $fillable = ['name', 'slug', 'description', 'type', 'status'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Category.php
Normal file
10
code/app/Model/kb/Category.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Category extends Model {
|
||||
|
||||
protected $table = 'category';
|
||||
protected $fillable = ['id', 'slug', 'name', 'description', 'status', 'parent', 'created_at', 'updated_at'];
|
||||
|
||||
}
|
14
code/app/Model/kb/Comment.php
Normal file
14
code/app/Model/kb/Comment.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Define the Model of comment table
|
||||
* @package default
|
||||
*/
|
||||
class Comment extends Model {
|
||||
|
||||
protected $table = 'comment';
|
||||
protected $fillable = ['article_id', 'name', 'email', 'website', 'comment', 'status'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Contact.php
Normal file
10
code/app/Model/kb/Contact.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Contact extends Model {
|
||||
|
||||
protected $table = 'contact';
|
||||
protected $fillable = ['name', 'subject', 'email', 'message'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Country.php
Normal file
10
code/app/Model/kb/Country.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model {
|
||||
|
||||
public $table = 'country';
|
||||
protected $fillable = ['country_code', 'country_name'];
|
||||
|
||||
}
|
10
code/app/Model/kb/DateFormat.php
Normal file
10
code/app/Model/kb/DateFormat.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DateFormat extends Model {
|
||||
|
||||
protected $table = 'date_time_format';
|
||||
//protected $fillable = ['id', 'name', 'description', 'status', 'parent', 'created_at', 'updated_at'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Faq.php
Normal file
10
code/app/Model/kb/Faq.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Faq extends Model {
|
||||
|
||||
protected $table = 'faq';
|
||||
protected $fillable = ['id', 'faq'];
|
||||
|
||||
}
|
9
code/app/Model/kb/Footer.php
Normal file
9
code/app/Model/kb/Footer.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Footer extends Model {
|
||||
|
||||
protected $table = 'footer';
|
||||
protected $fillable = ['title', 'footer'];
|
||||
}
|
10
code/app/Model/kb/Footer2.php
Normal file
10
code/app/Model/kb/Footer2.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Footer2 extends Model {
|
||||
|
||||
protected $table = 'footer2';
|
||||
protected $fillable = ['title', 'footer'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Footer3.php
Normal file
10
code/app/Model/kb/Footer3.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Footer3 extends Model {
|
||||
|
||||
protected $table = 'footer3';
|
||||
protected $fillable = ['title', 'footer'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Footer4.php
Normal file
10
code/app/Model/kb/Footer4.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Footer4 extends Model {
|
||||
|
||||
protected $table = 'footer4';
|
||||
protected $fillable = ['title', 'footer'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Options.php
Normal file
10
code/app/Model/kb/Options.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Options extends Model {
|
||||
|
||||
protected $table = 'options';
|
||||
protected $fillable = ['option_name', 'option_value', 'created_at', 'updated_at'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Page.php
Normal file
10
code/app/Model/kb/Page.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Page extends Model {
|
||||
|
||||
protected $table = 'pages';
|
||||
protected $fillable = ['name', 'slug', 'status', 'visibility', 'description'];
|
||||
|
||||
}
|
12
code/app/Model/kb/Relationship.php
Normal file
12
code/app/Model/kb/Relationship.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Relationship extends Model {
|
||||
|
||||
/* define the table */
|
||||
protected $table = 'article_relationship';
|
||||
/* define fillable fields */
|
||||
protected $fillable = ['id', 'category_id', 'article_id'];
|
||||
|
||||
}
|
16
code/app/Model/kb/Settings.php
Normal file
16
code/app/Model/kb/Settings.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Settings extends Model {
|
||||
|
||||
/**
|
||||
* @param $table, $fillable
|
||||
* @package default
|
||||
*/
|
||||
protected $table = 'settings';
|
||||
protected $fillable = ['language', 'dateformat', 'company_name', 'website', 'phone', 'address', 'logo', 'timezone',
|
||||
'background', 'version', 'pagination', 'port', 'host', 'encryption', 'email', 'password'];
|
||||
|
||||
}
|
9
code/app/Model/kb/Side1.php
Normal file
9
code/app/Model/kb/Side1.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Side1 extends Model {
|
||||
|
||||
protected $table = 'side1';
|
||||
protected $fillable = ['title', 'content'];
|
||||
}
|
9
code/app/Model/kb/Side2.php
Normal file
9
code/app/Model/kb/Side2.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Side2 extends Model {
|
||||
|
||||
protected $table = 'side2';
|
||||
protected $fillable = ['title', 'content'];
|
||||
}
|
10
code/app/Model/kb/Social.php
Normal file
10
code/app/Model/kb/Social.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Social extends Model {
|
||||
|
||||
protected $table = 'social';
|
||||
protected $fillable = ['linkedin', 'stumble', 'google', 'deviantart', 'flickr', 'skype', 'rss', 'twitter', 'facebook','youtube','vimeo','pinterest','dribbble','instagram'];
|
||||
|
||||
}
|
10
code/app/Model/kb/Timezone.php
Normal file
10
code/app/Model/kb/Timezone.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Timezone extends Model {
|
||||
|
||||
protected $table = 'timezones';
|
||||
protected $fillable = ['id', 'name', 'location'];
|
||||
|
||||
}
|
9
code/app/Model/kb/Zone.php
Normal file
9
code/app/Model/kb/Zone.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php namespace App\Model\kb;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Zone extends Model {
|
||||
|
||||
protected $table = 'zone';
|
||||
protected $fillable = ['zone_id', 'country_code', 'zone_name'];
|
||||
}
|
Reference in New Issue
Block a user