By default, Laravel Telescope allows you to visit the /telescope
route if:
- environment is
local
- passes the
viewTelescope
Gate check
By tracing how Telescope does it Authorization, I've found:
- It declares middlewares in its config file: Link
By default, Laravel Telescope allows you to visit the /telescope
route if:
local
viewTelescope
Gate checkBy tracing how Telescope does it Authorization, I've found:
<template> | |
<UsersRepo> | |
<template v-slot="{ isLoading, fetch, users }"> | |
<button | |
v-if="users.length === 0" | |
@click="fetch" | |
> | |
Fetch Users | |
</button> |
import { EventEmitter } from 'events'; | |
export default function scopeEventEmitter(events: EventEmitter, scope: string): EventEmitter { | |
return { | |
eventNames: () => events.eventNames().filter((name) => typeof name === 'string' && name.endsWith(`:${scope}`)), | |
on(event: string, listener) { | |
events.on(`${event}:${scope}`, listener); | |
return this; | |
}, |
interface Layouts { | |
[name: string]: LayoutRoot; | |
} | |
const layouts: Promise<Layouts> = new Promise(resolve => { | |
Promise.all([ | |
Icon.getImageSource("people"), | |
Icon.getImageSource("message") | |
]).then(icons => { | |
resolve({ |
<?php | |
namespace App\Exceptions; | |
class Handler | |
{ | |
/** | |
* Convert a validation exception into a JSON response. | |
* | |
* @param \Illuminate\Http\Request $request |
<?php | |
Validator::extend('day', function($attribute, $value, $parameters, $validator) { | |
// Laravel uses Carbon. Just `use Carbon\Carbon;` it | |
$day = Carbon::parse($value)->dayOfWeek; | |
switch (strtolower($parameters[0])) { | |
case 'sunday': | |
return $day == 0; |
<?php | |
namespace App\Exceptions; | |
use Exception; | |
use Illuminate\Auth\AuthenticationException; | |
// Don't forget to add this line as it is used by renderHttpException() | |
use Symfony\Component\HttpKernel\Exception\HttpException; |