client-update
changes changes1 page-changes lock color changes-2 footer page toggle-remove display-dropdown changes card-changes card changes-button chnages-article pages page-404-fix breadcrumbs-fix remove drop-down Apply fixes from StyleCI buttons fixes existing-fix changes-3 Apply fixes from StyleCI changes-4
This commit is contained in:
@@ -250,7 +250,7 @@ class FormController extends Controller
|
||||
// }
|
||||
}
|
||||
// dd($result);
|
||||
return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is').' '.$result[0].'. '.Lang::get('lang.Please-save-this-for-future-reference'));
|
||||
return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is').' '.$result[0].'. ');
|
||||
} else {
|
||||
return Redirect::back()->withInput($request->except('password'))->with('fails', Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken'));
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ use App\User;
|
||||
use Hash;
|
||||
// classes
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Lang;
|
||||
use Session;
|
||||
|
||||
@@ -332,11 +333,11 @@ class UnAuthController extends Controller
|
||||
*/
|
||||
public static function changeLanguage($lang)
|
||||
{
|
||||
//if(Cache::has('language'))
|
||||
//{
|
||||
// return Cache::get('language');
|
||||
//} else return 'false';
|
||||
// Cache::put('language',$)
|
||||
// if(Cache::has('language'))
|
||||
// {
|
||||
// return Cache::get('language');
|
||||
// } else return 'false';
|
||||
// Cache::put('language',$);
|
||||
$path = base_path('lang'); // Path to check available language packages
|
||||
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
|
||||
// dd(array_key_exists($lang, Config::get('languages')));
|
||||
@@ -433,8 +434,8 @@ class UnAuthController extends Controller
|
||||
{
|
||||
$path = base_path('lang'); // Path to check available language packages
|
||||
if (array_key_exists($lang, \Config::get('languages')) && in_array($lang, scandir($path))) {
|
||||
if (\Auth::check()) {
|
||||
$id = \Auth::user()->id;
|
||||
if (Auth::check()) {
|
||||
$id = Auth::user()->id;
|
||||
$user = User::find($id);
|
||||
$user->user_language = $lang;
|
||||
$user->save();
|
||||
|
@@ -3,7 +3,6 @@
|
||||
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\Model\kb\Article;
|
||||
@@ -90,9 +89,9 @@ class UserController extends Controller
|
||||
$pagination = $settings->pagination;
|
||||
$search = $request->input('s');
|
||||
$result = $article->where('name', 'LIKE', '%'.$search.'%')
|
||||
->orWhere('slug', 'LIKE', '%'.$search.'%')
|
||||
->orWhere('description', 'LIKE', '%'.$search.'%')
|
||||
->paginate($pagination);
|
||||
->orWhere('slug', 'LIKE', '%'.$search.'%')
|
||||
->orWhere('description', 'LIKE', '%'.$search.'%')
|
||||
->paginate($pagination);
|
||||
$result->setPath('search?s='.$search);
|
||||
$categorys = $category->get();
|
||||
|
||||
@@ -232,14 +231,31 @@ class UserController extends Controller
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function postComment($slug, Article $article, CommentRequest $request, Comment $comment)
|
||||
public function postComment($slug, Article $article, Request $request, Comment $comment)
|
||||
{
|
||||
$request->validate([
|
||||
'comment' => 'required',
|
||||
|
||||
]);
|
||||
|
||||
$article = $article->where('slug', $slug)->first();
|
||||
if (!$article) {
|
||||
return Redirect::back()->with('fails', Lang::get('lang.sorry_not_processed'));
|
||||
return response()->json(['success' => false, 'message' => Lang::get('lang.sorry_not_processed')]);
|
||||
}
|
||||
$id = $article->id;
|
||||
$comment->article_id = $id;
|
||||
|
||||
$comment->article_id = $article->id;
|
||||
|
||||
if (Auth::check()) {
|
||||
// Associate the comment with the authenticated user
|
||||
$comment->article_id = Auth::id();
|
||||
$comment->name = Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||
} else {
|
||||
// Set default values for non-authenticated user
|
||||
$comment->name = $request->input('name');
|
||||
$comment->email = $request->input('email');
|
||||
$comment->website = $request->input('website');
|
||||
}
|
||||
|
||||
if ($comment->fill($request->input())->save()) {
|
||||
return Redirect::back()->with('success', Lang::get('lang.your_comment_posted'));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user