Coding. AI-ng solutions. Reading concepts. *The loop. *
We sometimes stumble on problems that we've already encountered before but cared to little to remember the concept or solution.
Just another day as a wip programmer here. Here's what I noted today.
- in php, function type:
removeFiles() : stringyou can use?stringwhich means nullable return, so its either string or null - in php, to throw exceptions that can be handle by catch(): use
throw new Exception("the error") - PHP falsy values that can be catch by
!$variableName:null, false, 0, '0', '', [] - in Laravel,
return self::where('order_code', $orderCode)->get()this is an Eloquent query: returns a collection. - in Laravel, if you manually add models and controllers - you need to run
composer dump-autoloadphp artisan optimize:clear - in Laravel data validation, to check for uniqueness use this:
unique:table,column,except_id|unique:tblSample,name,' . $request->id - in tailwind CSS, element auto fill the available space use:
grid-cols-[repeat(auto-fit,minmax(200px,1fr))] - in HTML, to disable tab stop for specific elements add:
tabIndex={-1}
Disclaimer: These are concepts I noted for myself; the grammar isn’t polished - just for me to remember the things.
Top comments (0)