link ->https://formbuilder.online/
Wednesday, 27 July 2022
Laravel 9 run project on localhost without using `artisan serve` command.
1) Create a new file index.php in root directory of project, and copy paste below code
<?php
require __DIR__.'/public/index.php';
?>
2) Create a new file .htaccess in root directory of project, and copy paste below code
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Monday, 18 July 2022
Map
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 300px;
width: 300px;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<input type="text" name="pincode" id="pincode">
<button type="button" id="getLocationbtn"> Get Location</button>
<script>
// var marker;
// var map;
// navigator.geolocation.getCurrentPosition(showPosition);
// function initMap() {
// map = new google.maps.Map(document.getElementById('map'), {
// center: { lat: -34.397, lng: 150.644 },
// zoom: 8
// });
// }
// marker = new google.maps.Marker({
// map,
// });
// $.ajax({
// url: 'https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyDRhAqJg1_2d1jLVF3UidyeroO_JbaKXP0&callback=initMap&address=411041&sensor=false',
// type:'get',
// success:function(res)
// {
// console.log(res);
// }
// });
// function httpGet() {
// let xmlHttpReq = new XMLHttpRequest();
// let pincode=document.getElementById('pincode').value;
// let theUrl='https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyDRhAqJg1_2d1jLVF3UidyeroO_JbaKXP0&callback=initMap&address='+pincode+'&sensor=false';
// xmlHttpReq.open("GET", theUrl, false);
// xmlHttpReq.send(null);
// map.setCenter(JSON.parse(xmlHttpReq.responseText).results[0].geometry.location);
// marker.setCenter(JSON.parse(xmlHttpReq.responseText).results[0].geometry.location);
// marker.setPosition(JSON.parse(xmlHttpReq.responseText).results[0].geometry.location);
// marker.setMap(map);
// // console.log();
// initMap()
// }
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// @ts-nocheck TODO remove when fixed
let map;
let marker;
let geocoder;
let responseDiv;
let response;
function initMap() {
map = new google.maps.Map(document.getElementById("map"), {
zoom: 15,
center: { lat: -34.397, lng: 150.644 },
mapTypeControl: false,
});
geocoder = new google.maps.Geocoder();
const inputText = document.getElementById("#pincode");
console.log(inputText);
// inputText.type = "text";
// inputText.placeholder = "Enter a location";
const submitButton = document.getElementById("#getLocationbtn");
// submitButton.type = "button";
// submitButton.value = "Geocode";
// submitButton.classList.add("button", "button-primary");
const clearButton = document.createElement("input");
clearButton.type = "button";
clearButton.value = "Clear";
clearButton.classList.add("button", "button-secondary");
response = document.createElement("pre");
response.id = "response";
response.innerText = "";
responseDiv = document.createElement("div");
responseDiv.id = "response-container";
responseDiv.appendChild(response);
const instructionsElement = document.createElement("p");
marker = new google.maps.Marker({
map,
});
map.addListener("click", (e) => {
geocode({ location: e.latLng });
});
// submitButton.addEventListener("click", () =>
// geocode({ address: inputText.value })
// );
document.getElementById("getLocationbtn").onclick = function() {
geocode({ address:document.getElementById("pincode").value});
};
clearButton.addEventListener("click", () => {
clear();
});
clear();
}
function clear() {
marker.setMap(null);
responseDiv.style.display = "none";
}
function geocode(request) {
clear();
geocoder
.geocode(request)
.then((result) => {
const { results } = result;
map.setCenter(results[0].geometry.location);
marker.setPosition(results[0].geometry.location);
// map.zoom(4);
marker.setMap(map);
// responseDiv.style.display = "block";
// response.innerText = JSON.stringify(result, null, 2);
return results;
})
.catch((e) => {
alert("Geocode was not successful for the following reason: " + e);
});
}
window.initMap = initMap;
// console.log(httpGet());
</script>
<script src="https://maps.googleapis.com/maps/api/js?
key=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap"
async defer></script>
</body>
</html>
Subscribe to:
Posts (Atom)
Laravel Export data to csv
use Illuminate\Http\Response; // Define a function to export data to CSV function exportToCSV($exportData, $columns) { $filename = ...
-
download source code.zip from below link https://github.com/fideloper/TrustedProxy/releases extract the zip open vendor folder create a ne...
-
if ( $request -> hasfile ( 'project_nda' )) { if ( $SalesClosure -> project_nda != "" &...
-
1) Install Laravel excel in laravel existing project https://docs.laravel-excel.com/3.1/getting-started/installation.html 2)Create new clas...