This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$loop->index Returns a 0-based current loop iteration; 0 would mean the first iteration | |
$loop->iteration Returns a 1-based current loop iteration; 1 would mean the first iteration | |
$loop->remaining Number of iterations remaining in the loop; if there are a total of 10 iterations and the current iteration is 3, it would return 7 | |
$loop->count Returns the total number of iterations or the total number of items in the array | |
$loop->first Returns true if it is the first iteration or item in the loop else returns false. | |
$loop->last Returns true if it is the last iteration or item in the loop else return false. | |
$loop->depth Returns the depth or nesting level of the current loop; returns 2 if it is a loop within a loop and 3 if it is nested one level more | |
$loop->parentIf this loop is nested within another @foreach loop, parent returns the parent’s loop variable; If it is not tested, returns null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Install Laravel | |
composer create-project --prefer-dist laravel/laravel laravel_jetstream | |
2) Install Jetstream: | |
composer require laravel/jetstream | |
3) Create Auth with Inertia: | |
php artisan jetstream:install inertia | |
4) Now, let's node js package: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init | |
git add . | |
git commit -m "Add existing project files to Git" | |
git remote add origin https://github.com/mahendran-balaji/example-website.git | |
git push -u -f origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('beforeunload', function(e){ | |
e.preventDefault(); | |
e.returnvalue = ''; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Open Response.php File From vendor/Symfony/http-foundation/ */ | |
1) Refer attached File of Response.php | |
class Response | |
{ | |
public const HTTP_CONTINUE = 100; | |
public const HTTP_SWITCHING_PROTOCOLS = 101; | |
public const HTTP_PROCESSING = 102; // RFC2518 | |
public const HTTP_EARLY_HINTS = 103; // RFC8297 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Javascript string replace spaces with dash using replace() */ | |
/* | |
* Allowed only lower case letters (a-z) | |
* Here, the Regular expression is /\s+/g. | |
*/ | |
$('#slug-url').bind('keyup blur', function() { | |
var $th = $(this); | |
$th.val($th.val().replace(/(\s{2,})|[^a-z ']/g, ' ')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This sets the $time variable to the current hour in the 24 hour clock format */ | |
$time = date("H"); | |
/* Set the $timezone variable to become the current timezone */ | |
$timezone = date("e"); | |
/* If the time is less than 1200 hours, show good morning */ | |
if ($time < "12") { | |
echo "Good morning"; | |
} else | |
/* If the time is grater than or equal to 1200 hours, but less than 1700 hours, so good afternoon */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* javascript-string-replace-more-space-into-single-space */ | |
$('#blogtitle').bind('keyup blur', function() { | |
var $th = $(this); | |
$th.val($th.val().replace(/(\s{2,})|[^a-zA-Z']/g, ' ')); | |
$th.val($th.val().replace(/^\s*/, '')); | |
}); |