Laravel unique slug

Default laravel Str::slug() function doesn’t check the uniqueness of the slug from the database. We can use a technique to make the slug unique. The following is the code to use to make an unique slug: N.B: str_slug is deprecated from Laravel version 5.8....

JavaScript Print Area

Sometimes we need to add print button with print area in our dynamic or static web pages. Here is the JavaScript function to add print section. <script> function printDiv(divName) { var printContents = document.getElementById(divName).innerHTML; var...