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.4 KiB

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Slider;
use App\Models\Testimonial;
2 years ago
use App\Models\NewsAndUpdate;
2 years ago
use App\Models\Subscription;
2 years ago
use App\Models\AboutUs;
class HomeController extends Controller
{
public function index(){
$sliders = Slider::where('status',1)->get();
$testimonials = Testimonial::where('status',1)->get();
2 years ago
$blogs = NewsAndUpdate::where('status',1)->get();
2 years ago
$about_us = AboutUs::where('status',1)->get();
return view('welcome',compact('sliders','testimonials','blogs','about_us'));
}
2 years ago
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');
2 years ago
2 years ago
$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' => 'Successfully subscribed!','status' =>'Ok'],200);
}
}