|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\Slider;
|
|
|
|
use App\Models\Testimonial;
|
|
|
|
use App\Models\NewsAndUpdate;
|
|
|
|
use App\Models\Subscription;
|
|
|
|
use App\Models\AboutUs;
|
|
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
use Database\Seeders\AppointmentTableSeeder;
|
|
|
|
|
|
|
|
class HomeController extends Controller
|
|
|
|
{
|
|
|
|
public function runSeeder(){
|
|
|
|
Artisan::call('db:seed', ['--class' => AppointmentTableSeeder::class]);
|
|
|
|
}
|
|
|
|
public function runQueueJobs(){
|
|
|
|
Artisan::call('queue:listen');
|
|
|
|
}
|
|
|
|
public function index(){
|
|
|
|
$sliders = Slider::where('status',1)->get();
|
|
|
|
$testimonials = Testimonial::where('status',1)->get();
|
|
|
|
$blogs = NewsAndUpdate::where('status',1)->get();
|
|
|
|
$about_us = AboutUs::where('status',1)->get();
|
|
|
|
return view('welcome',compact('sliders','testimonials','blogs','about_us'));
|
|
|
|
}
|
|
|
|
public function subscribe(Request $request)
|
|
|
|
{
|
|
|
|
|
|
|
|
$email = $request->email;
|
|
|
|
$subscription = new Subscription();
|
|
|
|
$subscription->email = $email;
|
|
|
|
$subscription->save();
|
|
|
|
|
|
|
|
|
|
|
|
\Mail::send('subscribe_mail', array(
|
|
|
|
|
|
|
|
|
|
|
|
'email' =>\request('email'),
|
|
|
|
|
|
|
|
|
|
|
|
'subject' => 'Subscription Notice',
|
|
|
|
|
|
|
|
), function($message) use ($request){
|
|
|
|
$subject = 'Subscription Notice';
|
|
|
|
$message->subject('Subscription Notice');
|
|
|
|
|
|
|
|
$message->to('admin@eteducation.com.au', 'Et-Visa')->subject($subject);
|
|
|
|
$message->cc('extratechweb@gmail.com', 'Extratech')->subject($subject);
|
|
|
|
$message->cc('suman@extratechs.com.au', 'Extratech')->subject($subject);
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
return response()->json(['success' => 'Thank You for Subscribing !','status' =>'Ok'],200);
|
|
|
|
}
|
|
|
|
}
|