Skip to content

Instantly share code, notes, and snippets.

Working from home

Adi SK skadimoolam

Working from home
Block or report user

Report or block skadimoolam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View app.pcss
@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;
View UsersController.php
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();
View controller.php
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');
skadimoolam / checkbox.blade.php
Last active Sep 5, 2019
Customizable form partials for Laravel -
View checkbox.blade.php
$d = $d ?? null; // default value
<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>
View console.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();
You can’t perform that action at this time.