|
|
@ -4,8 +4,9 @@ namespace App\Http\Controllers\Admin; |
|
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
use App\Models\Contact; |
|
|
|
use App\Models\Contact; |
|
|
|
use App\Models\Referral; |
|
|
|
use App\Models\Enquiry; |
|
|
|
use App\Models\Subscription; |
|
|
|
use App\Models\Subscription; |
|
|
|
|
|
|
|
use App\Models\VisaService; |
|
|
|
use App\Models\Service; |
|
|
|
use App\Models\Service; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Routing\Route; |
|
|
|
use Illuminate\Routing\Route; |
|
|
@ -20,12 +21,14 @@ class HomeController extends Controller |
|
|
|
public function indexAdmin() |
|
|
|
public function indexAdmin() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(Auth::check()){ |
|
|
|
if(Auth::check()){ |
|
|
|
$service= Service::where('status',true); |
|
|
|
$visa_service= VisaService::where('status',true); |
|
|
|
|
|
|
|
$education_service= Service::where('status',true); |
|
|
|
|
|
|
|
$enquiry= Enquiry::all(); |
|
|
|
$contact= Contact::all(); |
|
|
|
$contact= Contact::all(); |
|
|
|
$subscription= Contact::all(); |
|
|
|
$subscription= Subscription::all(); |
|
|
|
$contacts = Contact::paginate(config('custom.per_page')); |
|
|
|
$contacts = Contact::paginate(config('custom.per_page')); |
|
|
|
// $referrals=Referral::paginate(config('custom.per_page')); |
|
|
|
// $referrals=Referral::paginate(config('custom.per_page')); |
|
|
|
return view('admin.index', compact( 'service', 'contact', 'contacts','subscription')); |
|
|
|
return view('admin.index', compact( 'visa_service', 'education_service', 'enquiry', 'contacts','contact','subscription')); |
|
|
|
} |
|
|
|
} |
|
|
|
return view('admin.login'); |
|
|
|
return view('admin.login'); |
|
|
|
} |
|
|
|
} |
|
|
@ -77,7 +80,7 @@ class HomeController extends Controller |
|
|
|
'password' => 'required|min:8|confirmed', |
|
|
|
'password' => 'required|min:8|confirmed', |
|
|
|
]); |
|
|
|
]); |
|
|
|
$user = auth()->user(); |
|
|
|
$user = auth()->user(); |
|
|
|
|
|
|
|
|
|
|
|
if(Hash::check($request->old_password,$user->password)){ |
|
|
|
if(Hash::check($request->old_password,$user->password)){ |
|
|
|
|
|
|
|
|
|
|
|
$user = User::findorfail($user->id); |
|
|
|
$user = User::findorfail($user->id); |
|
|
@ -88,7 +91,7 @@ class HomeController extends Controller |
|
|
|
return redirect()->back()->with('custom_error','Your old password is incorrect! Please try again.'); |
|
|
|
return redirect()->back()->with('custom_error','Your old password is incorrect! Please try again.'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|