Skip to content

Instantly share code, notes, and snippets.

View secrethash's full-sized avatar
🤓
Available for Freelance

Shashwat Mishra secrethash

🤓
Available for Freelance
View GitHub Profile
@secrethash
secrethash / composer.json
Last active January 13, 2023 02:18
Laravel Helper Function to create a Unique slug based on Provided Model Instance. Save 'slugify_model.php' in your 'app/Helpers/' directory and update your composer.json to reference and autoload the helper function.
{
...
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
...
@calebporzio
calebporzio / error_blade_directive.php
Created March 28, 2019 20:34
A little Blade directive to make working with validation errors a bit nicer.
<?php
// Usage:
// Before
@if ($errors->has('email'))
<span>{{ $errors->first('email') }}</span>
@endif
// After: