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\Support\Facades\Storage; | |
use App\Models\Post; | |
Artisan::command('generate:feed', function () { | |
$this->info("Generating RSS Feed"); | |
// It is important that you sort by the latest post | |
$posts = Post::where('published', true)->latest()->get(); |
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 | |
$d = $d ?? null; // default value | |
@endphp | |
<div class="form-group row"> | |
<label for="{{ $n }}" class="col-sm-4 col-form-label text-md-right"><b>{{ $l }}</b></label> | |
<div class="col-md-8"> | |
<input id="{{ $n }}" type="checkbox" class="form-control" name="{{ $n }}" value="1" @if(old($n, $d) == '1') checked @endif> | |
@if ($errors->has($n)) | |
<small class="text-danger">{{ $errors->first($n) }}</small> |
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
public function index(Request $request) | |
{ | |
$sortBy = 'id'; | |
$orderBy = 'desc'; | |
$perPage = 20; | |
$q = null; | |
if ($request->has('orderBy')) $orderBy = $request->query('orderBy'); | |
if ($request->has('sortBy')) $sortBy = $request->query('sortBy'); | |
if ($request->has('perPage')) $perPage = $request->query('perPage'); |
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
class UsersController | |
{ | |
// ...... | |
public function index(Request $request) { | |
$edit = null; | |
// We check if the edit parameter is set, if so we find the user with that ID | |
// This $edit variable can be used in our template | |
if ($request->has('edit')) $edit = User::where('id', $request->query('edit'))->first(); |
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
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; | |
.field { | |
@apply .rounded .border .py-2 .px-3 .text-gray-800; | |
} | |
.field-label { | |
@apply .mb-2 .uppercase .font-bold .text-lg .text-gray-900; |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", | |
"requestedTheme" : "system", | |
"launchMode":"maximized", | |
"profiles": | |
{ | |
"defaults": { |
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
# Add the domain name of your choice | |
SITE_URL=myapp.com |
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 | |
if (! function_exists('say_hi')) { | |
function say_hi($name) { | |
return 'Hi ' . $name; | |
} | |
} |
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 | |
$rawSettings = json_decode($request->get('settings'), true); | |
if ($rawSettings == null) abort(500); | |
config(['settings' => $rawSettings]); | |
$text = '<?php return ' . var_export(config('settings'), true) . ';'; | |
file_put_contents(config_path('settings.php'), $text); |
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\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register any application services. |
OlderNewer