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
| Route::get('/email/preview', function() { | |
| return (new Illuminate\Notifications\Messages\MailMessage) | |
| ->greeting('Welcome, John Doe!') | |
| ->line('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.') | |
| ->action('Sample button', 'https://laravel.com/') | |
| ->render(); | |
| }); |
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
| function validateCuitCuil(num) { | |
| const multipliers = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]; | |
| const validPrefixes = [20, 23, 24, 27, 30, 33, 34]; | |
| const digits = num.toString().split(''); | |
| const prefix = parseInt(digits[0]+digits[1]); | |
| if (digits.length != 11 || !validPrefixes.includes(prefix)) return false; | |
| const reduction = digits.reduce((carry, value, index) => { | |
| return carry + (value * multipliers[index]) |
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
| <?php | |
| function validateCuitCuil($num) | |
| { | |
| $multipliers = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]; | |
| $valid_prefixes = [20, 23, 24, 27, 30, 33, 34]; | |
| $digits = array_map('intval', str_split($value)); | |
| $prefix = intval($digits[0].$digits[1]); | |
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
| <?php | |
| function updateQueryString($oldQuery, $newQuery) { | |
| // Parse old string into array | |
| parse_str($oldQuery, $oldParams); | |
| // Parse new string into array | |
| parse_str($newQuery, $newParams); | |
| // Merge both arrays recursivley | |
| $merged = array_replace_recursive($oldParams, $newParams); | |
| //Return the result parsed into a query string |