You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
<?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;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
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->to('kctribikram7@gmail.com', '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);
|
|
}
|
|
}
|
|
|