how to pass values to modal form laravel 5.2 - laravel

I am beginner in Laravel
I use Laravel 5.2
I have in welcome.blade.php a tag which leads to data-target="#myModal", this modal form I made it in another page and included it in 4 pages I need to make it preview product details related to this page and product.
For example, in the welcome page, when I click on a quick view of the product, it calls this popup form and gives it an id to query and fetch all product details.
<!-- Quick View Content Start -->
<div class="modal fade" id="myModal" role="dialog">
<!-- Modal Dialog Box Start -->
<div class="modal-dialog max-width">
<!-- Modal content Start -->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal Body Start -->
<div class="modal-body">
<div class="quiick-view-details">
<!-- Product Thumbnail Start -->
<div class="main-product-thumbnail">
<div class="row">
<!-- Main Thumbnail Image Start -->
<div class="col-sm-5">
<!-- Thumbnail Large Image start -->
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<a data-fancybox="images" href="{{ Request::root() }}/website/img/new-products\3_1.jpg"><img src="{{ Request::root() }}/website/img/accessories\8.jpg" alt="product-view"></a>
</div>
<div id="menu1" class="tab-pane fade">
<a data-fancybox="images" href="{{ Request::root() }}/website/img/best-seller\6_1.jpg"><img src="{{ Request::root() }}/website/img/accessories\7_1.jpg" alt="product-view"></a>
</div>
<div id="menu2" class="tab-pane fade">
<a data-fancybox="images" href="{{ Request::root() }}/website/img/best-seller\6_2.jpg"><img src="{{ Request::root() }}/website/img/best-seller\6_2.jpg" alt="product-view"></a>
</div>
<div id="menu3" class="tab-pane fade">
<a data-fancybox="images" href="{{ Request::root() }}/website/img/best-seller\4_2.jpg"><img src="{{ Request::root() }}/website/img/best-seller\4_2.jpg" alt="product-view"></a>
</div>
<div id="menu4" class="tab-pane fade">
<a data-fancybox="images" href="{{ Request::root() }}/website/img/best-seller\9_2.jpg"> <img src="{{ Request::root() }}/website/img/best-seller\9_2.jpg" alt="product-view"></a>
</div>
<div id="menu5" class="tab-pane fade">
<a data-fancybox="images" href="{{ Request::root() }}/website/img/accessories\7_2.jpg"><img src="{{ Request::root() }}/website/img/accessories\7_2.jpg" alt="product-view"></a>
</div>
</div>
<!-- Thumbnail Large Image End -->
<!-- Thumbnail Image End -->
<div class="product-thumbnail">
<div class="thumb-menu owl-carousel">
<div class="active">
<a data-toggle="tab" href="#home"> <img src="{{ Request::root() }}/website/img/thumbnail\1.jpg" alt="product-thumbnail"></a>
</div>
<div>
<a data-toggle="tab" href="#menu1"> <img src="{{ Request::root() }}/website/img/thumbnail\2.jpg" alt="product-thumbnail"></a>
</div>
<div>
<a data-toggle="tab" href="#menu2"> <img src="{{ Request::root() }}/website/img/thumbnail\3.jpg" alt="product-thumbnail"></a>
</div>
<div>
<a data-toggle="tab" href="#menu3"> <img src="{{ Request::root() }}/website/img/thumbnail\4.jpg" alt="product-thumbnail"></a>
</div>
<div>
<a data-toggle="tab" href="#menu4"> <img src="{{ Request::root() }}/website/img/thumbnail\5.jpg" alt="product-thumbnail"></a>
</div>
<div>
<a data-toggle="tab" href="#menu5"> <img src="{{ Request::root() }}/website/img/thumbnail\6.jpg" alt="product-thumbnail"></a>
</div>
</div>
</div>
<!-- Thumbnail image end -->
</div>
<!-- Main Thumbnail Image End -->
<!-- Thumbnail Description Start -->
<div class="col-sm-7">
<div class="thubnail-desc fix">
<h2 class="product-header">Fusion Backpack</h2>
<div class="pro-ref">
<p><label>المخزون :</label><span class="stock" title="abailability">متاح فى المخزن</span></p>
<p><label class="text-uppercase">sku:</label><span>25-UG05</span></p>
</div>
<div class="rating-summary fix mtb-10">
<div class="rating-feedback f-right">
(1 تعليق)
أضف الى تعليقك
</div>
<div class="rating f-right">
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
</div>
</div>
<div class="pro-price mb-15">
<span>$19.00</span>
</div>
<div class="box-quantity mb-30">
<form action="#">
<input class="number" id="number" type="number" value="1">
<button class="action-prime">أضف الى السلة</button>
</form>
</div>
<div class="product-social-link">
<ul class="list-inline">
<li>أضف الى المفضلة</li>
<li>أضف الى المقارنة</li>
<li>ارسل بالبريد الالكترونى</li>
</ul>
</div>
<p class="ptb-30">وصف المنتج.</p>
</div>
</div>
<!-- Thumbnail Description End -->
</div>
<!-- Row End -->
<!-- Product Thumbnail Description Start -->
<div class="thumnail-desc">
<div class="row">
<div class="col-sm-12">
<ul class="main-thumb-desc pt-30">
<li class="active"><a data-toggle="tab" href="#dtails">التفاصيل</a></li>
<li><a data-toggle="tab" href="#reviews">التعليقات</a></li>
</ul>
<!-- Product Thumbnail Tab Content Start -->
<div class="tab-content thumb-content">
<div id="dtails" class="tab-pane fade in active">
<p>مواصفات المنتج<br>
<ul>
<li>Durable nylon construction.</li>
<li>2 main zippered compartments.</li>
<li>1 exterior zippered pocket.</li>
<li>Mesh side pouches.</li>
<li>Padded, adjustable straps.</li>
<li>Top carry handle.</li>
<li>Dimensions: 18" x 10" x 6".</li>
</ul>
</div>
<div id="reviews" class="tab-pane fade">
<!-- Reviews Start -->
<div class="review pb-40">
<h3 class="review-title mb-35">تعليقات الزوار</h3>
<h4 class="review-mini-title">Plazathemes</h4>
<ul class="review-list">
<!-- Single Review List Start -->
<li>
<span>الجودة</span>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<label>Plazathemes</label>
</li>
<!-- Single Review List End -->
<!-- Single Review List Start -->
<li>
<span>السعر</span>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<label>Review by Plazathemes</label>
</li>
<!-- Single Review List End -->
<!-- Single Review List Start -->
<li>
<span>القيمة</span>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<label>Posted on 7/20/16</label>
</li>
<!-- Single Review List End -->
</ul>
</div>
<!-- Reviews End -->
<!-- Reviews Start -->
<div class="review pt-50">
<h3 class="review-title mb-30">You're reviewing: <br><span>Go-Get'r Pushup Grips</span></h3>
<p class="mb-10 req">your rating</p>
<ul class="review-list">
<!-- Single Review List Start -->
<li>
<span>الجودة</span>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
</li>
<!-- Single Review List End -->
<!-- Single Review List Start -->
<li>
<span>السعر</span>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
</li>
<!-- Single Review List End -->
<!-- Single Review List Start -->
<li>
<span>القيمة</span>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
<i class="zmdi zmdi-star-outline"></i>
</li>
<!-- Single Review List End -->
</ul>
</div>
<!-- Reviews End -->
<!-- Reviews Field Start -->
<div class="riview-field mt-30">
<form autocomplete="off" action="#">
<div class="form-group">
<label class="req" for="n-name">اسمك</label>
<input type="text" class="form-control" id="n-name" required="required">
</div>
<div class="form-group">
<label class="req" for="summary">عنوان التعليق</label>
<input type="text" class="form-control" id="summary" required="required">
</div>
<div class="form-group">
<label class="req" for="comment">التعليق</label>
<textarea class="form-control" rows="5" id="comment" required="required"></textarea>
</div>
<button type="submit" class="btn-default">أضف التعليق</button>
</form>
</div>
<!-- Reviews Field Start -->
</div>
</div>
<!-- Product Thumbnail Tab Content End -->
</div>
</div>
<!-- Row End -->
</div>
<!-- Product Thumbnail Description End -->
</div>
<!-- Product Thumbnail End -->
</div>
<!-- Quick View Details End -->
</div>
<!-- Modal Body End -->
</div>
<!-- Modal Content End -->
</div>
<!-- Modal Dialog Box End -->
</div>
<!-- Quick View Content End -->

Try this in javascript code
<script>
$(document).on('click', '.show-modal', function() {
$("#picture_show").prop("src", "{{ URL::asset('img/products/')}}/"+$(this).data('target'));
});
</script>

you could use jquery for this purpose . u should hide the modal by default using css
and then when the user clicks the button u will call a javascript function using onclick and pass the product id to it . once the function is called , you will send an ajax request to server and get the details and simply set the returned data into the modal using class and id selectors and in the final step you will show the modal to the user .

Related

trying to submit a form in Go and it isnt working

I built an interactive resumé page that contains a form. I'm trying to send a message, using form in go and it isn't working. It's just keep taking back to the home page when I click on the submit button.
I want to receive a message when the user click the submit button.
I also want the sender to receive a confirmation that the message has been delivered.
This is my main.go file
package main
import (
"fmt"
"net/http"
"text/template"
)
func main() {
http.HandleFunc("/", routeIndexGet)
http.HandleFunc("/process", routeSubmitPost)
fmt.Println("server started at localhost:9000")
http.ListenAndServe(":9000",nil)
}
func `routeIndexGet`(w http.ResponseWriter, r *http.Request){
if r.Method == "GET" {
var tmpl = template.Must(template.New("form").ParseFiles("index.html"))
var err = tmpl.Execute(w, nil)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
return
}
http.Error(w, "", http.StatusBadRequest)
}
func routeSubmitPost(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
var tmpl = template.Must(template.New("result").ParseFiles("index.html"))
if err := r.ParseForm(); err != nil{
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
var name = r.FormValue("name")
var email = r.FormValue("email")
var subject = r.FormValue("subject")
var message = r.Form.Get("message")
var data = map[string]string{"name": name, "email":email, "subject": subject, "message":message}
if err := tmpl.Execute(w, data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
return
}
http.Error(w, "", http.StatusBadRequest)
}
This is my index.html
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>MeetMe - Resume Website Template</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css" >
<!-- Fonts -->
<link rel="stylesheet" type="text/css" href="assets/fonts/font-awesome.min.css">
<!-- Icon -->
<link rel="stylesheet" type="text/css" href="assets/fonts/simple-line-icons.css">
<!-- Slicknav -->
<link rel="stylesheet" type="text/css" href="assets/css/slicknav.css">
<!-- Menu CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/menu_sideslide.css">
<!-- Slider CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/slide-style.css">
<!-- Nivo Lightbox -->
<link rel="stylesheet" type="text/css" href="assets/css/nivo-lightbox.css" >
<!-- Animate -->
<link rel="stylesheet" type="text/css" href="assets/css/animate.css">
<!-- Main Style -->
<link rel="stylesheet" type="text/css" href="assets/css/main.css">
<!-- Responsive Style -->
<link rel="stylesheet" type="text/css" href="assets/css/responsive.css">
</head>
<body>
<!-- Header Area wrapper Starts -->
<header id="header-wrap">
<!-- Navbar Start -->
<nav class="navbar navbar-expand-lg fixed-top scrolling-navbar indigo">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
<span class="icon-menu"></span>
<span class="icon-menu"></span>
<span class="icon-menu"></span>
</button>
<img src="assets/img/logo.png" alt="">
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="onepage-nev navbar-nav mr-auto w-100 justify-content-end clearfix">
<li class="nav-item active">
<a class="nav-link" href="#hero-area">
Home
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">
About
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#services">
Services
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#resume">
Resume
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#portfolios">
Work
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact">
Contact
</a>
</li>
</ul>
</div>
</div>
<!-- Mobile Menu Start -->
<ul class="onepage-nev mobile-menu">
<li>
Home
</li>
<li>
about
</li>
<li>
Services
</li>
<li>
resume
</li>
<li>
Work
</li>
<li>
Contact
</li>
</ul>
<!-- Mobile Menu End -->
</nav>
<!-- Navbar End -->
<!-- Hero Area Start -->
<div id="hero-area" class="hero-area-bg">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 text-center">
<div class="contents">
<h5 class="script-font wow fadeInUp" data-wow-delay="0.2s">Hi This is</h5>
<h2 class="head-title wow fadeInUp" data-wow-delay="0.4s">Omoyibo Oghenetega</h2>
<p class="script-font wow fadeInUp" data-wow-delay="0.6s">Back-end Web Developer</p>
<ul class="social-icon wow fadeInUp" data-wow-delay="0.8s">
<li>
<a class="facebook" href="#"><i class="icon-social-facebook"></i></a>
</li>
<li>
<a class="twitter" href="#"><i class="icon-social-twitter"></i></a>
</li>
<li>
<a class="instagram" href="#"><i class="icon-social-instagram"></i></a>
</li>
<li>
<a class="linkedin" href="#"><i class="icon-social-linkedin"></i></a>
</li>
<li>
<a class="google" href="#"><i class="icon-social-google"></i></a>
</li>
</ul>
<div class="header-button wow fadeInUp" data-wow-delay="1s">
Get a Free Quote
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Hero Area End -->
</header>
<!-- Header Area wrapper End -->
<!-- About Section Start -->
<section id="about" class="section-padding">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="img-thumb wow fadeInLeft" data-wow-delay="0.3s">
<img class="img-fluid" src="assets/img/gallery/FB_IMG.jpg" alt="">
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="profile-wrapper wow fadeInRight" data-wow-delay="0.3s">
<h3>Hi Guys!</h3>
<p>I build digital product for web and mobile and i also maintain existing web and mobile project</p>
<div class="about-profile">
<ul class="admin-profile">
<li><span class="pro-title"> Name </span> <span class="pro-detail">Omoyibo Oghenetega</span></li>
<li><span class="pro-title"> Age </span> <span class="pro-detail">23 Years</span></li>
<li><span class="pro-title"> Experience </span> <span class="pro-detail">1 Years</span></li>
<li><span class="pro-title"> Country </span> <span class="pro-detail">Nigeria</span></li>
<li><span class="pro-title"> Location </span> <span class="pro-detail">portharcourt, Rivers state</span></li>
<li><span class="pro-title"> e-mail </span> <span class="pro-detail">tomoyibo#gmail.com</span></li>
<li><span class="pro-title"> Freelance </span> <span class="pro-detail">Available</span></li>
</ul>
</div>
<i class="icon-paper-clip"></i> Download Resume
<i class="icon-speech"></i> Contact Me
</div>
</div>
</div>
</div>
</section>
<!-- About Section End -->
<!-- Services Section Start -->
<section id="services" class="services section-padding">
<h2 class="section-title wow flipInX" data-wow-delay="0.4s">What I do</h2>
<div class="container">
<div class="row">
<!-- Services item -->
<div class="col-md-6 col-lg-3 col-xs-12">
<div class="services-item wow fadeInDown" data-wow-delay="0.3s">
<div class="icon">
<i class="icon-grid"></i>
</div>
<div class="services-content">
<h3>Back-end Development</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse condi.</p>
</div>
</div>
</div>
</section>
<!-- Services Section End -->
<!-- Resume Section Start -->
<div id="resume" class="section-padding">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="education wow fadeInRight" data-wow-delay="0.3s">
<ul class="timeline">
<li>
<i class="icon-graduation"></i>
<h2 class="timelin-title">Education</h2>
</li>
<li>
<div class="content-text">
<h3 class="line-title">Bsc In Electrical engineering university</h3>
<span>2015 - 2020</span>
<p class="line-text">Expenses as material breeding insisted building to in. Continual so distrusts pronounce by unwilling listening. Thing do taste on we manor.</p>
</div>
</li>
<li>
<div class="content-text">
<h3 class="line-title">Higher Secondary School - French village international college</h3>
<span>2009 - 2014</span>
<p class="line-text">Expenses as material breeding insisted building to in. Continual so distrusts pronounce by unwilling listening. Thing do taste on we manor.</p>
</div>
</li>
<li>
<div class="content-text">
<h3 class="line-title">Secondary School - Labratory High School</h3>
<span>2005 - 2010</span>
<p class="line-text">Expenses as material breeding insisted building to in. Continual so distrusts pronounce by unwilling listening. Thing do taste on we manor.</p>
</div>
</li>
</ul>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="experience wow fadeInRight" data-wow-delay="0.6s">
<ul class="timeline">
<li>
<i class="icon-briefcase"></i>
<h2 class="timelin-title">Experience</h2>
</li>
<li>
<div class="content-text">
<h3 class="line-title">junior back - end Developer</h3>
<span>Jan 2020 - Present</span>
<p class="line-text">Expenses as material breeding insisted building to in. Continual so distrusts pronounce by unwilling listening. Thing do taste on we manor.</p>
</div>
</li>
<li>
<div class="content-text">
<h3 class="line-title">software developer</h3>
<span>Nov 2019 - Dec 2020</span>
<p class="line-text">Expenses as material breeding insisted building to in. Continual so distrusts pronounce by unwilling listening. Thing do taste on we manor.</p>
</div>
</li>
<li>
<div class="content-text">
<h3 class="line-title">software developer</h3>
<span>Mar 2015 - Oct 2016</span>
<p class="line-text">Expenses as material breeding insisted building to in. Continual so distrusts pronounce by unwilling listening. Thing do taste on we manor.</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Resume Section End -->
<!-- Portfolio Section -->
<section id="portfolios" class="section-padding">
</section>
<!-- Portfolio Section Ends -->
<!-- Contact Section Start -->
<section id="contact" class="section-padding">
<div class="contact-form">
<div class="container">
<div class="row contact-form-area wow fadeInUp" data-wow-delay="0.4s">
<div class="col-md-6 col-lg-6 col-sm-12">
<div class="contact-block">
<h2>Contact Form</h2>
<form id="contactForm">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" id="name" name="name" placeholder="Name" required data-error="Please enter your name">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" placeholder="Email" id="email" class="form-control" name="email" required data-error="Please enter your email">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input type="text" placeholder="Subject" id="msg_subject" class="form-control" required data-error="Please enter your subject">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<textarea class="form-control" id="message" placeholder="Your Message" rows="5" data-error="Write your message" required></textarea>
<div class="help-block with-errors"></div>
</div>
<div class="submit-button">
<button class="btn btn-common" id="submit" type="submit">Send Message</button>
<div id="msgSubmit" class="h3 text-center hidden"></div>
<div class="clearfix"></div>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="col-md-6 col-lg-6 col-sm-12">
<div class="footer-right-area wow fadeIn">
<h2>Contact Address</h2>
<div class="footer-right-contact">
<div class="single-contact">
<div class="contact-icon">
<i class="fa fa-map-marker"></i>
</div>
<p>portharcourt, rivers state</p>
</div>
<div class="single-contact">
<div class="contact-icon">
<i class="fa fa-envelope"></i>
</div>
<p>tomoyibo#gmail.com</p>
</div>
<div class="single-contact">
<div class="contact-icon">
<i class="fa fa-phone"></i>
</div>
<p>+(234) 813 685 9270</p>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<object style="border:0; height: 450px; width: 100%;" data="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d34015.943594576835!2d-106.43242624069771!3d31.677719472407432!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x86e75d90e99d597b%3A0x6cd3eb9a9fcd23f1!2sCourtyard+by+Marriott+Ciudad+Juarez!5e0!3m2!1sen!2sbd!4v1533791187584"></object>
</div>
</div>
</div>
</div>
</section>
<!-- Contact Section End -->
<!-- Footer Section Start -->
<footer class="footer-area section-padding">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="footer-text text-center wow fadeInDown" data-wow-delay="0.3s">
<ul class="social-icon">
<div class="container">
<div class="row">
<div class="col-lg-1 col-md-2 col-xs-2">
<div class="img-thumb wow fadeInLeft" data-wow-delay="0.3s">
<img class="img-fluid" src="assets/img/gallery/zuri.png"i4g.png" alt="">
</div>
</div>
<div class="col-lg-1 col-md-2 col-xs-2">
<div class="img-thumb wow fadeInLeft" data-wow-delay="0.3s">
<img class="img-fluid" src="assets/img/gallery/hng.png" alt="">
</div>
</div>
<!-- Services Section End -->
<u1>
<li>
<a class="facebook" href="#"><i class="icon-social-facebook"></i></a>
</li>
<li>
<a class="github" href="#"><i class="icon-social-github"></i></a>
</li>
<li>
<a class="instagram" href="#"><i class="icon-social-instagram"></i></a>
</li>
<li>
<a class="instagram" href="#"><i class="icon-social-linkedin"></i></a>
</li>
<li>
<a class="instagram" href="#"><i class="icon-social-google"></i></a>
</li>
</ul>
<p>Copyright © 2018 UIdeck All Right Reserved</p>
</div>
</div>
</div>
</div>
</footer>
<!-- Footer Section End -->
<!-- Go to Top Link -->
<a href="#" class="back-to-top">
<i class="icon-arrow-up"></i>
</a>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="assets/js/jquery-min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.mixitup.js"></script>
<script src="assets/js/jquery.counterup.min.js"></script>
<script src="assets/js/waypoints.min.js"></script>
<script src="assets/js/wow.js"></script>
<script src="assets/js/jquery.nav.js"></script>
<script src="assets/js/jquery.easing.min.js"></script>
<script src="assets/js/nivo-lightbox.js"></script>
<script src="assets/js/jquery.slicknav.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/form-validator.min.js"></script>
<script src="assets/js/contact-form-script.min.js"></script>
<script src="assets/js/map.js"></script>
</body>
</html>
It seems there is no action attribute on your contactForm. Due to that, when you submit, it will submit to the page itself instead of the route you wanted it to submit to.
Consider adding an action attribute:
...
<form id="contactForm" action="/process">
<div class="row">
<div class="col-md-6">
<div class="form-group">
...

Section not displayed on browser

I am using laravel 6. I have problem with my section where its not display the result on browser. I have place #yield on my layout but half of section still not displayed
here my code
#section('main-content')
<section class="breadcrumbs">
<div class="container">
<div class="d-flex justify-content-between align-items-center">
<h2>Detail Tanaman</h2>
</div>
</div>
</section>
<!-- ======= Blog Section ======= -->
<section id="blog" class="blog">
<div class="container" data-aos="fade-up">
<div class="row">
<div class="col-lg-8 entries">
<article class="entry">
<div class="entry-img">
<img src="/img/bonsai.jpg" style ="width:100%; height:100%;" alt="" class="img-fluid">
</div>
<h2 class="entry-title">
{{$data->nama_tanaman}}
</h2>
here my layout
<a class="carousel-control-prev" href="#heroCarousel" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon bx bx-chevron-left" aria-hidden="true"></span>
</a>
<a class="carousel-control-next" href="#heroCarousel" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon bx bx-chevron-right" aria-hidden="true"></span>
</a>
</div>
</section><!-- End Hero -->
#yield('main-content')
You forget to add extends('master') (master is the name of your master page file) at the first of your section like:
In your master:
#yield('main-content')
In your section file:
#extends('master')
#section('main-content')
...
#endsection

content load dynamically inside quickView/ Popup in larave

I am trying to create an application with laravel and I am having some difficulty in understanding how to dynamically load content into a division according to the button clicked from the product icon.
This is the category page
<div class="row justify-content-center">
#foreach($ProductData as $Product)
<div class="col-6 col-md-4 col-lg-4 col-xl-3">
<div class="product product-7 text-center" title="{{$Product->product_name}}">
<figure class="product-media">
<span class="product-label label-new">New</span>
<a href="product.html">
<img src="{{ asset('images/product/thumbnail/'.$Product->photo) }}" alt="{{$Product->photo}}" class="product-image">
</a>
<div class="product-action-vertical">
<span>add to wishlist</span>
<span>Quick view</span>
<span>Compare</span>
</div><!-- End .product-action-vertical -->
<div class="product-action">
<span>add to cart</span>
</div><!-- End .product-action -->
</figure><!-- End .product-media -->
<div class="product-body">
<div class="product-cat">
Women
</div><!-- End .product-cat -->
<h3 class="product-title">{{$Product->product_name}}</h3><!-- End .product-title -->
<div class="product-price">
$ {{$Product->price}}
</div><!-- End .product-price -->
<div class="ratings-container">
<div class="ratings">
<div class="ratings-val" style="width: 20%;"></div><!-- End .ratings-val -->
</div><!-- End .ratings -->
<span class="ratings-text">(2)</span>
</div><!-- End .rating-container -->
<div class="product-nav product-nav-thumbs">
<a href="#" class="active">
<img src="{{ asset('assets/molla/assets/images/products/product-4-thumb.jpg') }}" alt="product desc">
</a>
<a href="#">
<img src="{{ asset('assets/molla/assets/images/products/product-4-2-thumb.jpg') }}" alt="product desc">
</a>
<a href="#">
<img src="{{ asset('assets/molla/assets/images/products/product-4-3-thumb.jpg') }}" alt="product desc">
</a>
</div><!-- End .product-nav -->
</div><!-- End .product-body -->
</div><!-- End .product -->
</div><!-- End .col-sm-6 col-lg-4 col-xl-3 -->
#endforeach
</div>
**and mypopup/quickView.html, where I want to load data dynamically is bellow: **
<div class="container quickView-container">
<div class="quickView-content">
<div class="row">
<div class="col-lg-7 col-md-6">
<div class="row">
<div class="product-left">
<a href="#one" class="carousel-dot active">
<img src="assets/molla/assets/images/popup/quickView/1.jpg">
</a>
<a href="#two" class="carousel-dot">
<img src="assets/molla/assets/images/popup/quickView/2.jpg">
</a>
<a href="#three" class="carousel-dot">
<img src="assets/molla/assets/images/popup/quickView/3.jpg">
</a>
<a href="#four" class="carousel-dot">
<img src="assets/molla/assets/images/popup/quickView/4.jpg">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
There are two ways you can dynamically load the modal/popup
Store the product details in data-* attribute of quick view button/anchor tag. Have a skeleton Quick View modal. On click of 'Quick View', trigger a javascript function to populate the skeleton modal with the product data fetched from data attributes.
Making AJAX call when user click on 'Quick View' button and populate the skeleton modal with the response data
Going by Approach #1 can you save you multiple network calls to the server as all the product related data (required to be shown in Quick View) is stored as data attributes
Updated
Example for Approach #1
<a class="btn btn-primary btnQuickView" data-product-name="Product Name" data-product-img="http://shop.com/product/image.jpg" data-product-price="200.00">Quick View</a>
Modal code
<!-- Quick View Modal -->
<div id="quickViewModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Title</h4>
</div>
<div class="modal-body">
<h1 id="modal-product-name"></h1>
<img id="modal-product-image" src="">
<p id="modal-product-price"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Load jQuery library -->
<script type="text/javascript">
$(function(){
$('body').on('click','.btnQuickView', function(e){
e.preventDefault();
var data = $(this).data();
$('#quickViewModal #modal-product-name').html(data.productName);
$('#quickViewModal #modal-product-name').attr('src', data.productImage);
$('#quickViewModal #modal-product-name').html(data.productPrice);
$('#quickViewModal').modal();
});
});
</script>

How to extend views with shared Layout in Laravel?

I have a collection of views that i want them to share a specific layout.
I created the layout master.blade.php ,in a folder i named it layouts.
From the docs , i found that i need to add the tag #extends and section('content') in my view so it fits under the layout :
#extends('layouts.master')
#section('content')
<div style="background-color:white;width:963px;height:100%">
<div style="padding-top:100px;padding-bottom:200px">
<h2 style="color:sandybrown; text-align:center"><b style="padding-right:40px">Contactez nous</b></h2>
<br />
<hr width="50%" color="gris" />
<div class="row">
<div class="col-md-6" style="padding:5%">
<form method="post" asp-controller="Home" asp-action="RegisterContact" style="padding-left:20px">
<label><span style="color:blue">Nom et prenom</span></label>
<br />
<input size=" 40" style="border-color:darkorange" asp-for="Name"/>
<br />
<label><span style="color:blue">E-mail</span></label>
<br />
<input size=" 40" asp-for="Email" style="border-color:darkorange" />
<br />
<label><span style="color:blue">Message</span></label>
<br />
<textarea rows="10" cols="40" style="border-color:darkorange" asp-for="Message"></textarea>
<br />
<button style="background-color:blue;"><span style="color:white">ENVOYER</span></button>
....
#endsection
but when i click in the link in the view's link in the navbar , this is what i get ?:
so is there a missing part in the logic ?
Update:
the view and the layout are both under the same folder :
C:\xampp\htdocs\laravel\resources\views\layouts
the view's name wasn't ending with .blade.php , but doing so now i get an exception :
InvalidArgumentException in FileViewFinder.php line 137: View [layouts.WhoWeAre] not found.
this is the body code of the layout :
</div>
<nav class="navbar navbar-expand-md bg-light navbar-light">
<div class="navbar-collapse collapse w-50">
<ul class="navbar-nav ml-auto">
<li class="nav-item navbar1 ">
<a class="nav-link" href="{{action('HomeController#WhoWeAre')}}"><span style="text-decoration: underline;"><B>Acceuil</B></span></a>
</li>
<li class="nav-item navbar1">
<a class="nav-link" ><span style="text-decoration: underline;"><B>Qui somme nous</B></span></a>
</li>
<li class="nav-item navbar1">
<a class="nav-link"><span style="text-decoration: underline;"><B>Specialités</B></span></a>
</li>
</ul>
</div>
<div>
<img src="images/decoupage/nawrass-logo.png " class="rounded-circle bg-light">
</div>
<div class="navbar-collapse collapse w-50 ">
<ul class="navbar-nav mr-auto">
<li class="nav-item navbar2">
<a class="nav-link" >
<span style="text-decoration: underline;"><B>Contactez-nous</B></span>
</a>
</li>
<li class="nav-item navbar2">
<img src="images/decoupage/location.png" style="padding-top: 7px">
<span style="padding-top: 15px">Djerba Houmet Souk</span>
</li>
<li class="nav-item navbar2">
<div class="row">
<div class="col-md-3" style="padding-top: 7px">
<img src="images/decoupage/phone.png">
</div>
<div class="col-md-8" style="font-size: 16px;">
<span>75 620 660 </span>
<br>
<span>98 816 962</span>
</div>
</div>
</li>
<li class="nav-item navbar2">
<img src="images/decoupage/fb.png" style="padding-top: 7px">
</li>
</ul>
</div>
</nav>
<div class="container " style="min-height:100%; padding-left:120px;flex:1;display:flex;flex-direction:column;">
<div style="flex:1;display:flex;flex-direction:column;">
#yield('content')
</div>
</div>
<div id="footer">
<div class="jumbotron " style="margin-top:0 ; background-color:blue">
<div class="container ">
<div class="row">
<div class="col-md-6">
<div class="card mb-3 " style="background-color: blue">
<div class="row no-gutters">
<div class="col-md-3 ">
<img src="images/decoupage/logo-white.png" class="card-img" alt="my card image">
</div>
<div class="col-md-9 ">
<div class="card-body ">
<p class=" card-text text-white " style="font-size: 14.45px">
Bienvenu a centre de formation ennawres: formation en coiffure hommes et dames Langues {francais, anglais...} ,photographie..et plusieurs d'autres..
</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-4 ">
<br/>
<img src="images/decoupage/phone.png">
<span class="text-white">
75620660-98815952
</span>
<br>
<br>
<img src="images/decoupage/location.png">
<span class="text-white">
Houmet Souk Djerba,1Km Ajim
</span>
</div>
</div>
<div class="row">
<div class="col-md-6 offset-md-4 text-white">
PROPULSE PAR MOSAIQUE WEB COPYRIGHT 2019
</div>
</div>
</div>
</div>
</div>
For information the click in the navbar "Qui sommes nous" link trigger this controller method:
public function WhoWeAre()
{
return view('layouts/WhoWeAre');
}
and this is routes.php :
Route::get('/', function () {
return view('welcome');
});
Route::get('/whoweare', 'HomeController#WhoWeAre');

Laravel loop damaged design

I have default template which is looks like this
when i add my loop it becomes like this
Issue
As you see in second image padding and margins are not as same as default one but html output looks fine
here is the code
<div class="col-md-5 col-xs-12 pad-l">
<div class="row">
#foreach($featuresTwo as $featuret)
#if($loop->first)
<div class="col-sm-12">
<div class="post-overaly-style hot-post-top clearfix">
<div class="post-thumb">
<a href="#">
<img class="img-fluid" src="theme/images/news/tech/gadget2.jpg" alt="" />
</a>
</div>
<div class="post-content">
<a class="post-cat" href="#">
#foreach($featuret->categories as $categoryt)
{{ $loop->first ? ' ' : ', ' }}
{{$categoryt->title}}
#endforeach
</a>
<h2 class="post-title title-large">
{{$featuret->title}}
</h2>
</div><!-- Post content end -->
</div><!-- Post Overaly end -->
</div><!-- Col end -->
#else
<div class="col-sm-6 pad-r-small">
<div class="post-overaly-style hot-post-bottom clearfix">
<div class="post-thumb">
<img class="img-fluid" src="theme/images/news/lifestyle/travel2.jpg" alt="" />
</div>
<div class="post-content">
<a class="post-cat" href="#">
#foreach($featuret->categories as $categoryt)
{{ $loop->first ? ' ' : ', ' }}
{{$categoryt->title}}
#endforeach
</a>
<h2 class="post-title title-medium">
{{$featuret->title}}
</h2>
</div><!-- Post content end -->
</div><!-- Post Overaly end -->
</div><!-- Col end -->
#endif
#endforeach
</div>
</div><!-- Col 5 end -->
Question
Where did I make mistake? How to fix it?
Thanks.
UPDATE
original html without loop
<div class="col-md-5 col-xs-12 pad-l">
<div class="row">
<div class="col-sm-12">
<div class="post-overaly-style hot-post-top clearfix">
<div class="post-thumb">
<a href="#">
<img class="img-fluid" src="images/news/tech/gadget2.jpg" alt="" />
</a>
</div>
<div class="post-content">
<a class="post-cat" href="#">Gadget</a>
<h2 class="post-title title-large">
Samsung Gear S3 review: A whimper, when smartwatches need a bang
</h2>
</div><!-- Post content end -->
</div><!-- Post Overaly end -->
</div><!-- Col end -->
<div class="col-sm-6 pad-r-small">
<div class="post-overaly-style hot-post-bottom clearfix">
<div class="post-thumb">
<img class="img-fluid" src="images/news/lifestyle/travel2.jpg" alt="" />
</div>
<div class="post-content">
<a class="post-cat" href="#">Travel</a>
<h2 class="post-title title-medium">
Early tourists choices to the sea of Maldiv…
</h2>
</div><!-- Post content end -->
</div><!-- Post Overaly end -->
</div><!-- Col end -->
<div class="col-sm-6 pad-l-small">
<div class="post-overaly-style hot-post-bottom clearfix">
<div class="post-thumb">
<img class="img-fluid" src="images/news/lifestyle/health1.jpg" alt="" />
</div>
<div class="post-content">
<a class="post-cat" href="#">Health</a>
<h2 class="post-title title-medium">
That wearable on your wrist could soon...
</h2>
</div><!-- Post content end -->
</div><!-- Post Overaly end -->
</div><!-- Col end -->
</div>
</div><!-- Col 5 end -->
........................................................................................................................
The original code for the two half width columns has one like this:
<div class="col-sm-6 pad-r-small">
And one like this:
<div class="col-sm-6 pad-l-small">
But you've used a loop to create two of the same like this:
<div class="col-sm-6 pad-r-small">
You should probably just key the features in the $featuresTwo array and drop the loops so you can replicate the code accurately.
Solved
Based on wheelmaker answer i got the idea and changed my div after #else to be like
#if($loop->last)
<div class="col-sm-6 pad-l-small">
#else
<div class="col-sm-6 pad-r-small">
#endif
and that solved the style issue.
PS: I'm accepting wheelmaker answer because he made me realized the
issue.

Resources