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 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
skadimoolam / checkbox.blade.php
Last active Jul 20, 2019
Customizable form partials for Laravel - https://laravelcollections.com
View checkbox.blade.php
@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>
View console.php
<?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.