Skip to content
Permalink
Browse files

Boring Boilerplate Stuff

  • Loading branch information...
barryvdh committed Aug 8, 2019
0 parents commit 341db1962c6690294959ed3d97fe4d436a29b4c0
@@ -0,0 +1,4 @@
/vendor
composer.phar
composer.lock
.DS_Store
@@ -0,0 +1,39 @@
{
"name": "fruitcake/laravel-telescope-toolbar",
"description": "Toolbar for Laravel Telescope",
"keywords": ["laravel", "debugbar", "profiler", "debug", "webprofiler", "toolbar", "telescope"],
"license": "MIT",
"authors": [
{
"name": "Fruitcake",
"email": "info@fruitcake.nl"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"require": {
"php": "^7.1.3",
"ext-json": "*",
"laravel/framework": "~5.8|^6",
"laravel/telescope": "^2"
},
"autoload": {
"psr-4": {
"Fruitcake\\TelescopeToolbar\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"laravel": {
"providers": [
"Fruitcake\\TelescopeToolbar\\ToolbarServiceProvider"
]
}
}
}
@@ -0,0 +1,16 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Telescope Toolbar Enabled
|--------------------------------------------------------------------------
|
| This options disables the toolbar. Laravel Telescope needs to be
| enabled also.
|
*/
'enabled' => env('TELESCOPE_ENABLED', true),
];
@@ -0,0 +1,19 @@
Copyright (C) 2019-present Fruitcake, Barry vd. Heuvel

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,4 @@
## Laravel Telescope Toolbar
[![Packagist License](https://poser.pugx.org/fruitcake/laravel-telescope-toolbar/license.png)](http://choosealicense.com/licenses/mit/)
[![Latest Stable Version](https://poser.pugx.org/fruitcake/laravel-telescope-toolbar/version.png)](https://packagist.org/packages/fruitcake/laravel-telescope-toolbar)
[![Total Downloads](https://poser.pugx.org/fruitcake/laravel-telescope-toolbar/d/total.png)](https://packagist.org/packages/fruitcake/laravel-telescope-toolbar)
No changes.
@@ -0,0 +1,10 @@
<?php
namespace Fruitcake\TelescopeToolbar\Http\Controllers;
use Illuminate\Routing\Controller;
class ToolbarController extends Controller
{
}
@@ -0,0 +1,18 @@
<?php
namespace Fruitcake\TelescopeToolbar\Http\Middleware;
class ToolbarMiddleware
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response
*/
public function handle($request, $next)
{
return $next($request);
}
}
@@ -0,0 +1 @@
<?php
@@ -0,0 +1,96 @@
<?php
namespace Fruitcake\TelescopeToolbar;
use Fruitcake\TelescopeToolbar\Http\Middleware\ToolbarMiddleware;
use Illuminate\Contracts\Http\Kernel;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
class ToolbarServiceProvider extends ServiceProvider
{
/**
* Bootstrap any package services.
*
* @return void
*/
public function boot()
{
if (! config('telescope.enabled') || ! config('telescope-toolbar.enabled')) {
return;
}
$this->registerRoutes();
$this->registerPublishing();
$this->registerMiddleware();
$this->loadViewsFrom(
__DIR__.'/../resources/views', 'telescope-toolbar'
);
}
/**
* Register the package routes.
*
* @return void
*/
private function registerRoutes()
{
Route::group($this->routeConfiguration(), function () {
$this->loadRoutesFrom(__DIR__.'/Http/routes.php');
});
}
/**
* Get the Telescope route group configuration array.
*
* @return array
*/
private function routeConfiguration()
{
return [
'namespace' => 'Fruitcake\TelescopeToolbar\Http\Controllers',
'prefix' => '_tt',
'middleware' => 'telescope',
];
}
/**
* Register the package's publishable resources.
*
* @return void
*/
private function registerPublishing()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../config/telescope-toolbar.php' => config_path('telescope-toolbar.php'),
], 'telescope-toolbar-config');
}
}
/**
* Register the package routes.
*
* @return void
*/
private function registerMiddleware()
{
/** @var \Illuminate\Foundation\Http\Kernel $kernel */
$kernel = $this->app[Kernel::class];
$kernel->pushMiddleware(ToolbarMiddleware::class);
}
/**
* Register any package services.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(
__DIR__.'/../config/telescope-toolbar.php', 'telescope-toolbar'
);
}
}

0 comments on commit 341db19

Please sign in to comment.
You can’t perform that action at this time.