Create Custom Validation Rules
- Create CheckPassword rules
php artisan make:rule CheckPassword
use Illuminate\Contracts\Validation\Rule;
Example showing Product
with max distance radius
from latitude
and longitude
public function scopeIsWithinMaxDistance($query, $latitude, $longitude, $radius = 25)
{
// for miles you'd use 3961 instead of 6371 (Kilometer)
$sql = "(6371 * acos(cos(radians($latitude))
* cos(radians(address.latitude))
* cos(radians(address.longitude)
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\Route; | |
class CurrentRouteMiddleware | |
{ | |
/** |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\App; | |
use Illuminate\Support\Facades\Session; | |
class LangMiddleware | |
{ |
const path = require("path"); | |
const mix = require("laravel-mix"); | |
mix.alias({ | |
"@": path.join(__dirname, "resources/js"), | |
"~": path.join(__dirname, "resources/sass"), | |
}); | |
mix | |
.js("resources/js/app.js", "public/js") |
// this project uses laravel Mix Version 6 and webpack 5 | |
// to solve this problem https://github.com/JeffreyWay/laravel-mix/issues/1889 | |
// for laravel Mix version 5 that you still want to use extract with dynamic-import please read my article | |
// https://medium.com/@iupin5212/bagaimana-codesplitting-di-laravel-mix-389fc76e37ae | |
// for list of npm command please refer to package.json | |
// react [name]__[local]___[hash:base64:5] | |
// discord [local]-[hash:base64:5] |
Vue.component('idr', { | |
template: '<input type="text" v-model="currentValue" @input="handleInput" />', | |
props: { | |
value: { | |
type: [String, Number], | |
default: "" | |
}, | |
}, | |
data: () => ({ | |
currentValue: '' |
const path = require("path"); | |
const mix = require("laravel-mix"); | |
require("laravel-mix-vue-css-modules"); // https://github.com/Aslam97/laravel-mix-vue-css-modules | |
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') | |
const purgeCss = mix.inProduction() | |
? [ | |
require("@fullhuman/postcss-purgecss")({ | |
content: ["resources/**/*.blade.php", "resources/**/*.vue"], | |
defaultExtractor(content) { |
// Lazy-loads view components, but with better UX. A loading view | |
// will be used if the component takes a while to load, falling | |
// back to a timeout view in case the page fails to load. You can | |
// use this component to lazy-load a route with: | |
// | |
// component: () => lazyLoadView(import('@views/my-view')) | |
// | |
// NOTE: Components loaded with this strategy DO NOT have access | |
// to in-component guards, such as beforeRouteEnter, | |
// beforeRouteUpdate, and beforeRouteLeave. You must either use |
##…or create a new repository on the command line
echo "# laravel-bank-bni" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Aslam97/laravel-bank-bni.git
git push -u origin main