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 | |
$articles = Article::where("created_at",">", Carbon::now()->subMonths(6))->get(); |
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
SELECT *, | |
TIMESTAMPDIFF(DAY,created_at, CURRENT_TIMESTAMP()) -- just to check it's working | |
FROM RentCar.companies | |
where TIMESTAMPDIFF(DAY, created_at, CURRENT_TIMESTAMP()) < 5; | |
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
SELECT *, | |
TIMESTAMPDIFF(DAY,created_at, CURRENT_TIMESTAMP()) -- just to check it's working | |
FROM RentCar.companies | |
where TIMESTAMPDIFF(DAY, created_at, CURRENT_TIMESTAMP()) < 5; | |
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 using select2 pluging (don't forget .trigger('change.select2')) | |
phoneCodeSelect.on('change', function () { | |
let countryName = $(this).find('option:selected').eq(0).text().replace(/\(.*\)/, '').trim().toUpperCase(); | |
countrySelect.val(countryName).trigger('change.select2');; | |
// countrySelect.find('option:selected').prop('selected', false); | |
// countrySelect.find('option[value=' + $(this).find('option:selected').eq(0).text().replace(/\(.*\)/, '').trim().toUpperCase() + ']').prop('selected', true); | |
console.log('ssssssssssssssssssssssssssssssssssss'); | |
console.log($(this).find('option:selected').eq(0).text().replace(/\(.*\)/, '').trim().toUpperCase()); | |
console.log(countrySelect); |
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
axios.get('/json/countries') | |
.then(function (resp) { | |
countriesCities = resp.data; | |
// alert(JSON.stringify(countriesCities['Afghanistan'])); | |
cc_bloodHound = new Bloodhound({ | |
datumTokenizer: Bloodhound.tokenizers.whitespace, | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
reinitialize: true, | |
locale: null |
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 ucwords(str) { | |
str = str.toLowerCase().replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g, function (replace_latter) { | |
return replace_latter.toUpperCase(); | |
}); //Can use also /\b[a-z]/g | |
return str; //First letter capital in each word | |
} |
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 | |
Route::group(['prefix' => 'js'], function () { | |
Route::get('filterizr', function () { | |
return response()->file(base_path('node_modules/filterizr/dist/jquery.filterizr.min.js'), [ | |
'Content-Type' => 'application/javascript' | |
]); | |
})->name('js.filterizr'); | |
}); |
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
-- safe mode update , .... | |
-- update | |
SET SQL_SAFE_UPDATES = 0; | |
-- your nice code here | |
SET SQL_SAFE_UPDATES = 1; | |
-- Set a column all record values to a one value | |
SET SQL_SAFE_UPDATES = 0; |
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
var lastLogoUrl = '{{route('storage.companies.logo', ['file' => basename($cmpny->logo)])}}'; | |
{{-- var isLogoUpdated = false; --}} | |
var updatedData = null; | |
var oldData = null; | |
var form = null; | |
var dataToSend = null; |
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 formArrayToObject(formArray) {//serialize data function | |
var returnArray = {}; | |
for (var i = 0; i < formArray.length; i++){ | |
returnArray[formArray[i]['name']] = formArray[i]['value']; | |
} | |
return returnArray; | |
} |