subscription

et#12
Mahesh Sharma 2 years ago
parent d83ce78ce0
commit c3ba2dd657
  1. 30
      app/Http/Controllers/HomeController.php
  2. 2
      public/frontend/css/style.css
  3. 36
      resources/views/layout/app.blade.php
  4. 74
      resources/views/subscribe_mail.blade.php
  5. 4
      resources/views/welcome.blade.php
  6. 1
      routes/web.php

@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use App\Models\Slider; use App\Models\Slider;
use App\Models\Testimonial; use App\Models\Testimonial;
use App\Models\NewsAndUpdate; use App\Models\NewsAndUpdate;
use App\Models\Subscription;
class HomeController extends Controller class HomeController extends Controller
{ {
@ -15,4 +16,33 @@ class HomeController extends Controller
$blogs = NewsAndUpdate::where('status',1)->get(); $blogs = NewsAndUpdate::where('status',1)->get();
return view('welcome',compact('sliders','testimonials','blogs')); return view('welcome',compact('sliders','testimonials','blogs'));
} }
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' => 'Successfully subscribed!','status' =>'Ok'],200);
}
} }

@ -1992,7 +1992,7 @@ Responsive Codes
/* Extra large screens, TV css */ /* Extra large screens, TV css */
@media only screen and (min-width: 1201px) and (max-width: 1220px) { @media only screen and (min-width: 1201px) and (max-width: 1220px) {
.navbar-list{ .navbar-list{
gap: 1rem; gap: 0.5rem;
} }
} }
/* Extra large screens, TV css ends */ /* Extra large screens, TV css ends */

@ -279,5 +279,41 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
@yield('script') @yield('script')
<script>
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
function subscribe(){
var email = document.getElementById('subscribe_email');
if(email.value != null){
$.ajax({
url: "/subscribe",
type:"POST",
data:{
email:email.value,
},
success:function(response){
if (response) {
// alert(response.success);
$('#success-message').text(response.success);
email.value = '';
// $("#contactForm")[0].reset();
}
},
error: function(response) {
}
});
}
}
</script>
</html> </html>

@ -0,0 +1,74 @@
<style>
.main-column{
display:flex;
width:100%;
}
.column-one{
width:50%;
}
.column-two{
width: 50%;
}
.column-three{
width:100%;
}
.radio-list{
list-style-type: none!important;
}
.radio-list li{
list-style: none!important;
}
.radio-list li input{
margin-right: 10px;
}
.column-four{
width:100%
}
.form-table{
width:100%
}
@media print{
.main-column{
display:flex;
width:100%;
}
.column-one{
width:50%;
}
.column-two{
width: 50%;
}
.column-three{
width:100%;
}
.radio-list{
list-style-type: none!important;
}
.radio-list li{
list-style: none!important;
}
.radio-list li input{
margin-right: 10px;
}
.column-four{
width:100%
}
.form-table{
width:100%
}
}
</style>
<h1>Subscription Notice</h1>
<br />
<div class="main-column">
<div class="column-one">
<b>Email:</b> {{ $email }}<br /><br />
</div>
</div>

@ -92,7 +92,7 @@
</div> </div>
<h2>Abroad Study</h2> <h2>Abroad Study</h2>
<p>Explore and Choose the Course that Meets your Dream</p> <p>Explore and Choose the Course that Meets your Dream</p>
<a href="">Learn More</a> <a href="{{url('/study-abroad')}}">Learn More</a>
</div> </div>
<div class="service-card"> <div class="service-card">
<div class="service-icon"> <div class="service-icon">
@ -127,7 +127,7 @@
</div> </div>
<h2>Abroad Study</h2> <h2>Abroad Study</h2>
<p>Explore and Choose the Course that Meets your Dream</p> <p>Explore and Choose the Course that Meets your Dream</p>
<a href="">Learn More</a> <a href="{{url('study-abroad')}}">Learn More</a>
</div> </div>
<div class="service-card"> <div class="service-card">
<div class="service-icon"> <div class="service-icon">

@ -75,6 +75,7 @@ Route::get('blogs', [BlogController::class,'index']);
Route::get('blog/{slug}', [BlogController::class,'blog_detail']); Route::get('blog/{slug}', [BlogController::class,'blog_detail']);
Route::get('faqs', [FrontendFaqController::class,'index']); Route::get('faqs', [FrontendFaqController::class,'index']);
Route::post('image-upload', [ImageUploadController::class, 'storeImage'])->name('image.upload'); //upload image in CkEditor Route::post('image-upload', [ImageUploadController::class, 'storeImage'])->name('image.upload'); //upload image in CkEditor
Route::post('/subscribe', [HomeController::class, 'subscribe']);
Route::group(['middleware'=>['auth']],function (){ Route::group(['middleware'=>['auth']],function (){
//routes for admin //routes for admin

Loading…
Cancel
Save