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
ComponentAttributeBag::macro('fallback', function($classes) { | |
$fallbacks = Collection::wrap($classes) | |
->mapWithKeys(fn($partial, $fallback) => is_int($fallback) ? [$partial => Str::of($partial)->before("-")->when(Str::contains("-", $partial), fn($string) => $string->append('-'))->__toString()] : [$fallback => $partial]) | |
->toArray(); | |
return $this->class($fallbacks); | |
}); |
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 | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Illuminate\Routing\Controller; | |
use App\Models\{{ model }}; | |
use App\Http\Requests\{{ model | basename }}\{{ store_request }}; | |
use App\Http\Requests\{{ model | basename }}\{{ update_request }}; |
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
export default defineConfig({ | |
plugins: [ | |
laravel(['resources/js/app.js']), | |
{ | |
name: 'ziggy', | |
enforce: 'post', | |
handleHotUpdate({ server, file }) { | |
if (file.includes('/routes/') && file.endsWith('.php')) { | |
exec('php artisan ziggy:generate', (error, stdout) => error === null && console.log(` > Ziggy routes generated!`)) | |
} |
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 | |
namespace App; | |
class Str | |
{ | |
public static function lower($subject) | |
{ | |
return strtolower($subject); | |
} |
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 | |
namespace App; | |
class Foo | |
{ | |
} |