This file contains hidden or 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
Description: To automatically run Laravel Sail on any Laravel project without having to specify the ./vendor/bin/sail path each time, you can create a simple shell script or alias. This will allow you to start Sail with a single command. Here’s how you can do it: | |
This instruction was made on Windows 11 Version 23H2 WSL2 Ubuntu22.04 | |
0. Begin | |
1. Create sail file inside /usr/local/bin | |
$ sudo touch sail |
This file contains hidden or 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
/** | |
* NOTE: This is a jQuery code used withing Blunova websites {GetAJob|CB|Docreko|OrderPayroll...} | |
* Place this code inside WP active themes js folder | |
*/ | |
/** | |
* Tweak for Gravity Forms month name | |
* This will target all instance of date field month dropdown | |
*/ |
This file contains hidden or 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
Reference: https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/ | |
1. Create folder named: `C:\xampp\apache\crt` | |
2. Create files and store those file inside the newly created folder. | |
2.1 cert.conf | |
2.2 make-cert.bat | |
3. Edit cert.conf and Run make-cert.bat | |
Change {{DOMAIN}} text using the domain we want to use, in this case site.test and save. |
This file contains hidden or 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
CODE INPUT: | |
Route::get('sample', function(){ | |
$date = '06-28-2021'; //@fromFormat" m-d-Y | |
$date2 = Carbon::createFromFormat('m-d-Y', $date)->format('Y-m-d'); //@toFormat" Y-m-d | |
return response()->json(['from:' => $date, 'to' => $date2]); | |
}); | |
RESULT: |
This file contains hidden or 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
To make Postman work with POST/PUT requests... | |
https://laravel.com/docs/5.2/routing#csrf-x-csrf-token | |
In addition to checking for the CSRF token as a POST parameter, the Laravel VerifyCsrfToken middleware will also check for the X-CSRF-TOKEN request header. | |
1. Store the token in a "meta" tag at the top of your root view file (layouts/app.blade.php)... | |
<meta name="csrf-token" content="{{ csrf_token() }}"> | |
** If using jQuery, you can now instruct it to include the token in all request headers. | |
$.ajaxSetup({ |
This file contains hidden or 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
Example: Uploading file to specific customer of a given ID. | |
$foldername = 'customers/customer-'.$customer->id; | |
$base64_image = $request->input('field_name'); // Image is sent as Base64 | |
// Currently accepts image only | |
if (preg_match('/^data:image\/(\w+);base64,/', $base64_image)) { | |
$data = substr($base64_image, strpos($base64_image, ',') + 1); | |
$extension = getFileExtension($base64_image); |
This file contains hidden or 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
# References: | |
# https://docs.gravityforms.com/dynamically-populating-drop-down-fields/ | |
# https://docs.gravityforms.com/gf_field_select/ | |
add_filter( 'gform_pre_render_45', 'disable_ADA_ACA_transactions' ); | |
add_filter( 'gform_pre_validation_45', 'disable_ADA_ACA_transactions' ); | |
add_filter( 'gform_pre_submission_filter_45', 'disable_ADA_ACA_transactions' ); | |
add_filter( 'gform_admin_pre_render_45', 'disable_ADA_ACA_transactions' ); | |
function disable_ADA_ACA_transactions( $form ) { |
This file contains hidden or 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
# http://inlinedocs.gravityhelp.com/class-GFAPI.html | |
# https://docs.gravityforms.com/getting-started-with-the-gravity-forms-api-gfapi/ | |
# working code | |
# notes: we are to going to lists submitted entries of the current loggedin user. | |
$form_ids = [19, 20, 21, 22, 23, 24, 25, 26]; // accepts single or array of form id's. | |
$search_criteria = array( | |
'field_filters' => array( | |
'mode' => 'any', |
This file contains hidden or 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
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
This file contains hidden or 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
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |
NewerOlder