A Pen by Edson Perotoni on CodePen.
This file contains 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 | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Schema; |
This file contains 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
:: Auto commit your files with dynamic add and commit files on "app\Http\Validators" path and name the commit relatively to "app\Http\Validators" without ".php" (last for characters) [note the loop starts from "\app\Http\Validators" path] | |
@echo off | |
setlocal enabledelayedexpansion | |
for /R .\app\Http\Validators %%i in (*.*) do ( | |
set "relativePath=%%i" | |
set "relativePath=!relativePath:*\app\Http\Validators\=!" | |
set "relativePath=!relativePath:~0,-4!" | |
git add "%%i" & git commit -m "chore: update !relativePath!" |
This file contains 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
/** | |
* Generates a slug for URL from a given title. | |
* | |
* @param string $title The title to convert to a slug. | |
* @param string $separator The separator to use in the slug. Default is '-'. | |
* @param string|null $language The language to use for ASCII conversion. Default is null. | |
* @param array $dictionary An array of dictionary words to replace in the slug. Default is ['@' => 'at']. | |
* @return string The generated slug. | |
*/ |
This file contains 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
if (! function_exists('when')) { | |
/** | |
* Execute the given callback function if the condition is true. | |
* | |
* @param bool $condition | |
* @param callable $function | |
* @return mixed|null | |
*/ | |
function when(bool $condition, callable $function) | |
{ |
This file contains 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
// Get all files from the App\Models directory | |
$modelFiles = glob(app_path('Models/*.php')); | |
foreach ($modelFiles as $modelFile) { | |
// Extract the filename without the .php extension for the function name | |
$modelName = strtolower(basename($modelFile, '.php')); | |
// Create the full class name | |
$fullClassName = "\\App\\Models\\" . ucfirst($modelName); |
This file contains 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
{ | |
"content" : [ | |
{ | |
"label": "name", | |
"labelColor": "bright", | |
"value": "Muath Alsowadi", | |
"valueColor": "fgYellow" | |
}, | |
{ | |
"label": "email", |
NewerOlder