Merge pull request #2195 from CachetHQ/laravel-5.3-shift

Laravel 5.3 Shift
This commit is contained in:
James Brooks
2016-10-22 11:32:46 +01:00
committed by GitHub
74 changed files with 1046 additions and 495 deletions

View File

@@ -69,12 +69,12 @@ final class AddComponentCommand
*/
public $rules = [
'name' => 'required|string',
'description' => 'string',
'status' => 'int|min:1|max:4',
'link' => 'url',
'order' => 'int',
'group_id' => 'int',
'enabled' => 'bool',
'description' => 'required|string',
'status' => 'required|int|min:1|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',
'group_id' => 'nullable|int',
'enabled' => 'nullable|bool',
];
/**

View File

@@ -77,13 +77,13 @@ final class UpdateComponentCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'description' => 'string',
'status' => 'int|min:1|max:4',
'link' => 'url',
'order' => 'int',
'group_id' => 'int',
'enabled' => 'bool',
'name' => 'nullable|string',
'description' => 'nullable|string',
'status' => 'nullable|int|min:1|max:4',
'link' => 'nullable|url',
'order' => 'nullable|int',
'group_id' => 'nullable|int',
'enabled' => 'nullable|bool',
];
/**

View File

@@ -53,9 +53,9 @@ final class AddComponentGroupCommand
*/
public $rules = [
'name' => 'required|string',
'order' => 'int',
'collapsed' => 'int|between:0,3',
'visible' => 'bool',
'order' => 'required|int',
'collapsed' => 'required|int|between:0,3',
'visible' => 'required|bool',
];
/**

View File

@@ -61,10 +61,10 @@ final class UpdateComponentGroupCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'order' => 'int',
'collapsed' => 'int|between:0,3',
'visible' => 'bool',
'name' => 'nullable|string',
'order' => 'nullable|int',
'collapsed' => 'nullable|int|between:0,3',
'visible' => 'nullable|bool',
];
/**

View File

@@ -104,14 +104,14 @@ final class ReportIncidentCommand
public $rules = [
'name' => 'required|string',
'status' => 'required|int|min:0|max:4',
'message' => 'string',
'visible' => 'bool',
'component_id' => 'int|required_with:component_status',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'notify' => 'bool',
'stickied' => 'bool',
'incident_date' => 'string',
'template' => 'string',
'message' => 'required|string',
'visible' => 'nullable|bool',
'component_id' => 'nullable|required_with:component_status|int',
'component_status' => 'nullable|required_with:component_id|int|min:1|max:4',
'notify' => 'nullable|bool',
'stickied' => 'required|bool',
'incident_date' => 'nullable|string',
'template' => 'nullable|string',
];
/**

View File

@@ -48,9 +48,9 @@ final class ReportMaintenanceCommand
*/
public $rules = [
'name' => 'required|string',
'message' => 'string',
'notify' => 'bool',
'timestamp' => 'string',
'message' => 'required|string',
'notify' => 'nullable|bool',
'timestamp' => 'required|string',
];
/**

View File

@@ -105,15 +105,15 @@ final class UpdateIncidentCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'status' => 'int|min:0|max:4',
'message' => 'string',
'visible' => 'bool',
'component_id' => 'int',
'component_status' => 'int|min:1|max:4|required_with:component_id',
'notify' => 'bool',
'stickied' => 'bool',
'template' => 'string',
'name' => 'nullable|string',
'status' => 'nullable|int|min:0|max:4',
'message' => 'nullable|string',
'visible' => 'nullable|bool',
'component_id' => 'nullable|int',
'component_status' => 'nullable|int|min:1|max:4|required_with:component_id',
'notify' => 'nullable|bool',
'stickied' => 'nullable|bool',
'template' => 'nullable|string',
];
/**

View File

@@ -55,10 +55,8 @@ final class UpdateIncidentUpdateCommand
* @var string[]
*/
public $rules = [
'update' => 'required',
'status' => 'int|min:1|max:4',
'message' => 'string',
'user' => 'required',
'status' => 'nullable|int|min:1|max:4',
'message' => 'nullable|string',
];
/**

View File

@@ -91,15 +91,15 @@ final class AddMetricCommand
public $rules = [
'name' => 'required|string',
'suffix' => 'required|string',
'description' => 'string',
'display_chart' => 'bool',
'default_value' => 'int',
'calc_type' => 'int',
'display_chart' => 'int',
'places' => 'int|between:0,4',
'default_view' => 'int|between:0,3',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
'description' => 'nullable|string',
'display_chart' => 'nullable|bool',
'default_value' => 'required|int',
'calc_type' => 'required|int',
'display_chart' => 'nullable|int',
'places' => 'nullable|int|between:0,4',
'default_view' => 'required|int|between:0,3',
'threshold' => 'nullable|numeric|between:0,10',
'order' => 'nullable|int',
];
/**

View File

@@ -42,8 +42,8 @@ final class AddMetricPointCommand
* @var string[]
*/
public $rules = [
'value' => 'numeric',
'created_at' => 'string',
'value' => 'required|numeric',
'created_at' => 'required|string',
];
/**

View File

@@ -98,17 +98,17 @@ final class UpdateMetricCommand
* @var string[]
*/
public $rules = [
'name' => 'string',
'suffix' => 'string',
'description' => 'string',
'display_chart' => 'bool',
'default_value' => 'numeric',
'calc_type' => 'int|in:0,1',
'display_chart' => 'int',
'places' => 'numeric|between:0,4',
'default_view' => 'numeric|between:0,4',
'threshold' => 'numeric|between:0,10',
'order' => 'int',
'name' => 'nullable|string',
'suffix' => 'nullable|string',
'description' => 'nullable|string',
'display_chart' => 'nullable|bool',
'default_value' => 'nullable|numeric',
'calc_type' => 'nullable|int|in:0,1',
'display_chart' => 'nullable|int',
'places' => 'nullable|numeric|between:0,4',
'default_view' => 'nullable|numeric|between:0,4',
'threshold' => 'nullable|numeric|between:0,10',
'order' => 'nullable|int',
];
/**

View File

@@ -55,8 +55,8 @@ final class UpdateMetricPointCommand
* @var string[]
*/
public $rules = [
'value' => 'numeric',
'created_at' => 'string',
'value' => 'nullable|numeric',
'created_at' => 'nullable|string',
];
/**

View File

@@ -53,8 +53,8 @@ final class AddUserCommand
*/
public $rules = [
'username' => 'required|string',
'password' => 'string',
'level' => 'int',
'password' => 'required|string',
'level' => 'required|int',
];
/**

View File

@@ -48,9 +48,9 @@ final class SignupUserCommand
*/
public $rules = [
'username' => 'required|string',
'password' => 'string',
'password' => 'required|string',
'email' => 'required|string|email',
'level' => 'int',
'level' => 'required|int',
];
/**

View File

@@ -63,7 +63,7 @@ class ReportIncidentCommandHandler
'stickied' => $command->stickied,
];
if ($template = IncidentTemplate::where('slug', $command->template)->first()) {
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
$data['message'] = $this->parseTemplate($template, $command);
} else {
$data['message'] = $command->message;

View File

@@ -56,7 +56,7 @@ class UpdateIncidentCommandHandler
*/
public function handle(UpdateIncidentCommand $command)
{
if ($template = IncidentTemplate::where('slug', $command->template)->first()) {
if ($template = IncidentTemplate::where('slug', '=', $command->template)->first()) {
$command->message = $this->parseTemplate($template, $command);
}

View File

@@ -63,7 +63,7 @@ class AddMetricPointCommandHandler
protected function findOrCreatePoint(AddMetricPointCommand $command)
{
$buffer = Carbon::now()->subMinutes($command->metric->threshold);
$point = MetricPoint::where('metric_id', $command->metric->id)->where('value', $command->value)->where('created_at', '>=', $buffer)->first();
$point = MetricPoint::where('metric_id', '=', $command->metric->id)->where('value', '=', $command->value)->where('created_at', '>=', $buffer)->first();
if ($point) {
return $point;

View File

@@ -36,7 +36,7 @@ class SubscribeSubscriberCommandHandler
*/
public function handle(SubscribeSubscriberCommand $command)
{
if ($subscriber = Subscriber::where('email', $command->email)->first()) {
if ($subscriber = Subscriber::where('email', '=', $command->email)->first()) {
return $subscriber;
}

View File

@@ -16,7 +16,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvi
class EventServiceProvider extends ServiceProvider
{
/**
* The event handler mappings for the application.
* The event listener mappings for the application.
*
* @var array
*/

View File

@@ -58,7 +58,7 @@ class ModuleServiceProvider extends ServiceProvider
*/
public function boot(BladeCompiler $blade)
{
$blade->directive('modules', function ($group = null) {
$blade->directive('modules', function ($group) {
return sprintf(
'<?php echo $app->call(\'%s@%s\', [
\'factory\' => $__env,
@@ -68,7 +68,7 @@ class ModuleServiceProvider extends ServiceProvider
]); ?>',
ModulesRenderer::class,
'renderModules',
$group === null ? 'null' : $group
empty($group) ? 'null' : $group
);
});
}

View File

@@ -11,8 +11,17 @@
namespace CachetHQ\Cachet\Foundation\Providers;
use Barryvdh\Cors\HandleCors;
use CachetHQ\Cachet\Http\Middleware\Acceptable;
use CachetHQ\Cachet\Http\Middleware\Timezone;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Routing\Router;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
/**
* This is the route service provider.
@@ -35,34 +44,36 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define the route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
parent::boot();
$this->app->call([$this, 'bind']);
}
/**
* Define the bindings for the application.
*
* @param \Illuminate\Routing\Router $router
*
* @return void
*/
public function boot(Router $router)
public function bind(Router $router)
{
parent::boot($router);
$this->registerBindings();
}
/**
* Register model bindings.
*
* @return void
*/
protected function registerBindings()
{
$this->app->router->model('component', 'CachetHQ\Cachet\Models\Component');
$this->app->router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup');
$this->app->router->model('incident', 'CachetHQ\Cachet\Models\Incident');
$this->app->router->model('incident_template', 'CachetHQ\Cachet\Models\IncidentTemplate');
$this->app->router->model('metric', 'CachetHQ\Cachet\Models\Metric');
$this->app->router->model('metric_point', 'CachetHQ\Cachet\Models\MetricPoint');
$this->app->router->model('setting', 'CachetHQ\Cachet\Models\Setting');
$this->app->router->model('subscriber', 'CachetHQ\Cachet\Models\Subscriber');
$this->app->router->model('subscription', 'CachetHQ\Cachet\Models\Subscription');
$this->app->router->model('user', 'CachetHQ\Cachet\Models\User');
$router->model('component', 'CachetHQ\Cachet\Models\Component');
$router->model('component_group', 'CachetHQ\Cachet\Models\ComponentGroup');
$router->model('incident', 'CachetHQ\Cachet\Models\Incident');
$router->model('incident_template', 'CachetHQ\Cachet\Models\IncidentTemplate');
$router->model('incident_update', 'CachetHQ\Cachet\Models\IncidentUpdate');
$router->model('metric', 'CachetHQ\Cachet\Models\Metric');
$router->model('metric_point', 'CachetHQ\Cachet\Models\MetricPoint');
$router->model('setting', 'CachetHQ\Cachet\Models\Setting');
$router->model('subscriber', 'CachetHQ\Cachet\Models\Subscriber');
$router->model('subscription', 'CachetHQ\Cachet\Models\Subscription');
$router->model('tag', 'CachetHQ\Cachet\Models\Tag');
$router->model('user', 'CachetHQ\Cachet\Models\User');
}
/**
@@ -82,8 +93,60 @@ class RouteServiceProvider extends ServiceProvider
$class = str_replace('/', '\\', $class);
$class = substr($class, 0, -4);
$this->app->make("CachetHQ\\Cachet\\Http\\Routes${class}")->map($router);
$routes = $this->app->make("CachetHQ\\Cachet\\Http\\Routes${class}");
if ($routes::$browser) {
$this->mapForBrowser($router, $routes);
} else {
$this->mapOtherwise($router, $routes);
}
}
});
}
/**
* Wrap the routes in the browser specific middleware.
*
* @param \Illuminate\Routing\Router $router
* @param object $routes
*
* @return void
*/
protected function mapForBrowser(Router $router, $routes)
{
$middleware = [
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
];
$router->group(['middleware' => $middleware], function (Router $router) use ($routes) {
$routes->map($router);
});
}
/**
* Wrap the routes in the basic middleware.
*
* @param \Illuminate\Routing\Router $router
* @param object $routes
*
* @return void
*/
protected function mapOtherwise(Router $router, $routes)
{
$middleware = [
HandleCors::class,
SubstituteBindings::class,
Acceptable::class,
Timezone::class,
];
$router->group(['middleware' => $middleware], function (Router $router) use ($routes) {
$routes->map($router);
});
}
}

View File

@@ -119,7 +119,7 @@ class ApiController extends AbstractApiController
{
$templateSlug = Binput::get('slug');
if ($template = IncidentTemplate::where('slug', $templateSlug)->first()) {
if ($template = IncidentTemplate::where('slug', '=', $templateSlug)->first()) {
return $template;
}

View File

@@ -100,7 +100,7 @@ class IncidentController extends Controller
return View::make('dashboard.incidents.add')
->withPageTitle(trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard'))
->withComponentsInGroups(ComponentGroup::with('components')->get())
->withComponentsOutGroups(Component::where('group_id', 0)->get())
->withComponentsOutGroups(Component::where('group_id', '=', 0)->get())
->withIncidentTemplates(IncidentTemplate::all());
}
@@ -236,7 +236,7 @@ class IncidentController extends Controller
->withPageTitle(trans('dashboard.incidents.edit.title').' - '.trans('dashboard.dashboard'))
->withIncident($incident)
->withComponentsInGroups(ComponentGroup::with('components')->get())
->withComponentsOutGroups(Component::where('group_id', 0)->get());
->withComponentsOutGroups(Component::where('group_id', '=', 0)->get());
}
/**

View File

@@ -200,7 +200,7 @@ class SettingsController extends Controller
{
$this->subMenu['security']['active'] = true;
$unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '')->get();
$unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '=', '')->get();
Session::flash('redirect_to', $this->subMenu['security']['url']);

View File

@@ -298,7 +298,9 @@ class SetupController extends Controller
$envValue = env($envKey) ?: 'null';
file_put_contents($path, str_replace(
$envKey.'='.$envValue, $envKey.'='.$value, file_get_contents($path)
$envKey.'='.$envValue,
$envKey.'='.$value,
file_get_contents($path)
));
} catch (InvalidPathException $e) {
//

View File

@@ -89,7 +89,7 @@ class SubscribeController extends Controller
throw new NotFoundHttpException();
}
$subscriber = Subscriber::where('verify_code', $code)->first();
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
if (!$subscriber) {
throw new BadRequestHttpException();
@@ -149,7 +149,7 @@ class SubscribeController extends Controller
$subscriber = Subscriber::where('verify_code', '=', $code)->first();
$usedComponentGroups = Component::enabled()->where('group_id', '>', 0)->groupBy('group_id')->pluck('group_id');
$componentGroups = ComponentGroup::whereIn('id', $usedComponentGroups)->orderBy('order')->get();
$ungroupedComponents = Component::enabled()->where('group_id', 0)->orderBy('order')->orderBy('created_at')->get();
$ungroupedComponents = Component::enabled()->where('group_id', '=', 0)->orderBy('order')->orderBy('created_at')->get();
if (!$subscriber) {
throw new BadRequestHttpException();

View File

@@ -25,26 +25,6 @@ class Kernel extends HttpKernel
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken',
],
'api' => [
'Barryvdh\Cors\HandleCors',
'CachetHQ\Cachet\Http\Middleware\Acceptable',
'CachetHQ\Cachet\Http\Middleware\Timezone',
],
];
/**
* The application's route middleware.
*
@@ -52,7 +32,8 @@ class Kernel extends HttpKernel
*/
protected $routeMiddleware = [
'admin' => 'CachetHQ\Cachet\Http\Middleware\Admin',
'auth' => 'CachetHQ\Cachet\Http\Middleware\Authenticate',
'can' => 'Illuminate\Auth\Middleware\Authorize',
'auth' => 'Illuminate\Auth\Middleware\Authenticate',
'auth.api' => 'CachetHQ\Cachet\Http\Middleware\ApiAuthentication',
'guest' => 'CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated',
'localize' => 'CachetHQ\Cachet\Http\Middleware\Localize',

View File

@@ -20,6 +20,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class ApiRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = false;
/**
* Define the api routes.
*
@@ -32,7 +39,6 @@ class ApiRoutes
$router->group([
'namespace' => 'Api',
'prefix' => 'api/v1',
'middleware' => ['api'],
], function (Registrar $router) {
$router->group(['middleware' => ['auth.api']], function (Registrar $router) {
$router->get('ping', 'GeneralController@ping');

View File

@@ -20,6 +20,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class AuthRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the auth routes.
*
@@ -30,7 +37,7 @@ class AuthRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'ready'],
'middleware' => ['ready'],
'prefix' => 'auth',
], function (Registrar $router) {
$router->get('login', [

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class ApiRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard api routes.
*
@@ -31,7 +38,7 @@ class ApiRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/api',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class BaseRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard base routes.
*
@@ -31,7 +38,7 @@ class BaseRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
], function (Registrar $router) {
$router->get('admin', 'DashboardController@redirectAdmin');

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class ComponentRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard component routes.
*
@@ -31,7 +38,7 @@ class ComponentRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/components',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class IncidentRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard incident routes.
*
@@ -31,7 +38,7 @@ class IncidentRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/incidents',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class MetricRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard metric routes.
*
@@ -31,7 +38,7 @@ class MetricRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/metrics',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class ScheduleRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard schedule routes.
*
@@ -31,7 +38,7 @@ class ScheduleRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/schedule',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class SettingRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard setting routes.
*
@@ -31,7 +38,7 @@ class SettingRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/settings',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class SubscriberRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard subscriber routes.
*
@@ -31,7 +38,7 @@ class SubscriberRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/subscribers',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class TeamRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard team routes.
*
@@ -31,7 +38,7 @@ class TeamRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/team',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class TemplateRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard template routes.
*
@@ -31,7 +38,7 @@ class TemplateRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/templates',
], function (Registrar $router) {

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class UserRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the dashboard user routes.
*
@@ -31,7 +38,7 @@ class UserRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'auth'],
'middleware' => ['auth'],
'namespace' => 'Dashboard',
'prefix' => 'dashboard/user',
], function (Registrar $router) {

View File

@@ -20,6 +20,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class FeedRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the status page routes.
*
@@ -30,7 +37,7 @@ class FeedRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'ready'],
'middleware' => ['ready'],
], function (Registrar $router) {
$router->get('/atom/{component_group?}', [
'as' => 'get:feed.atom',

View File

@@ -21,6 +21,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class SetupRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the setup routes.
*
@@ -31,7 +38,7 @@ class SetupRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'setup'],
'middleware' => ['setup'],
'prefix' => 'setup',
], function (Registrar $router) {
$router->get('/', [

View File

@@ -20,6 +20,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class SignupRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the signup routes.
*
@@ -30,7 +37,7 @@ class SignupRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'ready', 'guest'],
'middleware' => ['ready', 'guest'],
'prefix' => 'signup',
], function (Registrar $router) {
$router->get('invite/{code}', [

View File

@@ -20,6 +20,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class StatusPageRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the status page routes.
*
@@ -30,7 +37,7 @@ class StatusPageRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'ready', 'localize'],
'middleware' => ['ready', 'localize'],
], function (Registrar $router) {
$router->get('/', [
'as' => 'get:status-page',

View File

@@ -20,6 +20,13 @@ use Illuminate\Contracts\Routing\Registrar;
*/
class SubscribeRoutes
{
/**
* Defines if these routes are for the browser.
*
* @var bool
*/
public static $browser = true;
/**
* Define the subscribe routes.
*
@@ -30,7 +37,7 @@ class SubscribeRoutes
public function map(Registrar $router)
{
$router->group([
'middleware' => ['web', 'ready', 'localize', 'subscribers'],
'middleware' => ['ready', 'localize', 'subscribers'],
], function (Registrar $router) {
$router->get('subscribe', [
'as' => 'get:subscribe',

View File

@@ -75,9 +75,12 @@ class Component extends Model implements HasPresenter
* @var string[]
*/
public $rules = [
'name' => 'required|string',
'status' => 'int|required',
'link' => 'url',
'name' => 'required|string',
'status' => 'required|int',
'order' => 'nullable|int',
'group_id' => 'nullable|int',
'link' => 'nullable|url',
'enabled' => 'required|bool',
];
/**
@@ -148,7 +151,7 @@ class Component extends Model implements HasPresenter
*/
public function scopeStatus(Builder $query, $status)
{
return $query->where('status', $status);
return $query->where('status', '=', $status);
}
/**
@@ -173,7 +176,7 @@ class Component extends Model implements HasPresenter
*/
public function scopeEnabled(Builder $query)
{
return $query->where('enabled', true);
return $query->where('enabled', '=', true);
}
/**
@@ -185,7 +188,7 @@ class Component extends Model implements HasPresenter
*/
public function scopeDisabled(Builder $query)
{
return $query->where('enabled', false);
return $query->where('enabled', '=', false);
}
/**
@@ -198,7 +201,7 @@ class Component extends Model implements HasPresenter
public function scopeUngrouped(Builder $query)
{
return $query->enabled()
->where('group_id', 0)
->where('group_id', '=', 0)
->orderBy('order')
->orderBy('created_at');
}

View File

@@ -75,9 +75,9 @@ class ComponentGroup extends Model implements HasPresenter
*/
public $rules = [
'name' => 'required|string',
'order' => 'int',
'collapsed' => 'int',
'visible' => 'bool',
'order' => 'required|int',
'collapsed' => 'required|int',
'visible' => 'required|bool',
];
/**
@@ -172,7 +172,7 @@ class ComponentGroup extends Model implements HasPresenter
*/
public function scopeVisible(Builder $query)
{
return $query->where('visible', self::VISIBLE_GUEST);
return $query->where('visible', '=', self::VISIBLE_GUEST);
}
/**

View File

@@ -69,7 +69,7 @@ class Incident extends Model implements HasPresenter
*/
protected $casts = [
'visible' => 'int',
'stickied' => 'int',
'stickied' => 'bool',
'scheduled_at' => 'date',
'deleted_at' => 'date',
];
@@ -97,12 +97,12 @@ class Incident extends Model implements HasPresenter
* @var string[]
*/
public $rules = [
'component_id' => 'int',
'name' => 'required',
'component_id' => 'nullable|int',
'name' => 'required|string',
'status' => 'required|int',
'visible' => 'required|bool',
'stickied' => 'bool',
'message' => 'required',
'stickied' => 'required|bool',
'message' => 'required|string',
];
/**
@@ -169,7 +169,7 @@ class Incident extends Model implements HasPresenter
*/
public function scopeVisible(Builder $query)
{
return $query->where('visible', 1);
return $query->where('visible', '=', 1);
}
/**
@@ -181,7 +181,7 @@ class Incident extends Model implements HasPresenter
*/
public function scopeStickied(Builder $query)
{
return $query->where('stickied', true);
return $query->where('stickied', '=', true);
}
/**
@@ -193,7 +193,7 @@ class Incident extends Model implements HasPresenter
*/
public function scopeScheduled(Builder $query)
{
return $query->where('status', 0)->where('scheduled_at', '>=', Carbon::now());
return $query->where('status', '=', 0)->where('scheduled_at', '>=', Carbon::now());
}
/**
@@ -206,7 +206,7 @@ class Incident extends Model implements HasPresenter
public function scopeNotScheduled(Builder $query)
{
return $query->where('status', '>', 0)->orWhere(function ($query) {
$query->where('status', 0)->where(function ($query) {
$query->where('status', '=', 0)->where(function ($query) {
$query->whereNull('scheduled_at')->orWhere('scheduled_at', '<=', Carbon::now());
});
});

View File

@@ -44,7 +44,7 @@ class IncidentTemplate extends Model
*/
public $rules = [
'name' => 'required|string',
'slug' => 'string',
'slug' => 'required|string',
'template' => 'required|string',
];
@@ -72,7 +72,7 @@ class IncidentTemplate extends Model
*/
public static function forSlug($slug, $columns = ['*'])
{
$template = static::where('slug', $slug)->firstOrFail($columns);
$template = static::where('slug', '=', $slug)->firstOrFail($columns);
return $template;
}

View File

@@ -56,7 +56,7 @@ class IncidentUpdate extends Model implements HasPresenter
* @var string[]
*/
public $rules = [
'incident_id' => 'int',
'incident_id' => 'required|int',
'status' => 'required|int',
'message' => 'required|string',
'user_id' => 'required|int',

View File

@@ -94,12 +94,11 @@ class Metric extends Model implements HasPresenter
public $rules = [
'name' => 'required',
'suffix' => 'required',
'display_chart' => 'bool',
'default_value' => 'numeric',
'places' => 'numeric|between:0,4',
'default_view' => 'numeric|between:0,3',
'threshold' => 'numeric|between:0,10',
'threshold' => 'int',
'display_chart' => 'required|bool',
'default_value' => 'required|numeric',
'places' => 'required|numeric|between:0,4',
'default_view' => 'required|numeric|between:0,3',
'threshold' => 'required|numeric|between:0,10',
];
/**
@@ -135,7 +134,7 @@ class Metric extends Model implements HasPresenter
*/
public function scopeDisplayable(Builder $query)
{
return $query->where('display_chart', 1);
return $query->where('display_chart', '=', true);
}
/**
@@ -145,7 +144,7 @@ class Metric extends Model implements HasPresenter
*/
public function getShouldDisplayAttribute()
{
return $this->display_chart === 1;
return $this->display_chart;
}
/**

View File

@@ -59,7 +59,7 @@ class MetricPoint extends Model implements HasPresenter
* @var string[]
*/
public $rules = [
'value' => 'numeric|required',
'value' => 'required|numeric',
];
/**

View File

@@ -101,7 +101,7 @@ class Subscriber extends Model implements HasPresenter
*/
public function scopeIsGlobal(Builder $query)
{
return $query->where('global', true);
return $query->where('global', '=', true);
}
/**
@@ -116,7 +116,7 @@ class Subscriber extends Model implements HasPresenter
{
return $query->select('subscribers.*')
->join('subscriptions', 'subscribers.id', '=', 'subscriptions.subscriber_id')
->where('subscriptions.component_id', $component_id);
->where('subscriptions.component_id', '=', $component_id);
}
/**

View File

@@ -45,8 +45,8 @@ class Subscription extends Model
* @var string[]
*/
public $rules = [
'subscriber_id' => 'int|required',
'component_id' => 'int',
'subscriber_id' => 'required|int',
'component_id' => 'nullable|int',
];
/**
@@ -79,7 +79,7 @@ class Subscription extends Model
*/
public function scopeForSubscriber(Builder $query, $subscriber_id)
{
return $query->where('subscriber_id', $subscriber_id);
return $query->where('subscriber_id', '=', $subscriber_id);
}
/**
@@ -92,7 +92,7 @@ class Subscription extends Model
*/
public function scopeForComponent(Builder $query, $component_id)
{
return $query->where('component_id', $component_id);
return $query->where('component_id', '=', $component_id);
}
/**
@@ -108,7 +108,7 @@ class Subscription extends Model
return $query->select('subscriptions.*')
->join('subscribers', 'subscriptions.subscriber_id', '=', 'subscribers.id')
->where(function ($query) {
$query->where('subscriptions.component_id', $component_id)
$query->where('subscriptions.component_id', '=', $component_id)
->orWhere('subscribers.global');
})
->whereNotNull('subscribers.verified_at');

View File

@@ -12,12 +12,10 @@
namespace CachetHQ\Cachet\Models;
use AltThree\Validator\ValidatingTrait;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Hash;
/**
@@ -25,9 +23,9 @@ use Illuminate\Support\Facades\Hash;
*
* @author James Brooks <james@alt-three.com>
*/
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
class User extends Authenticatable
{
use Authenticatable, CanResetPassword, ValidatingTrait;
use Notifiable, ValidatingTrait;
/**
* The admin level of user.
@@ -133,7 +131,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
public function scopeAdmins(Builder $query)
{
return $query->where('level', self::LEVEL_ADMIN);
return $query->where('level', '=', self::LEVEL_ADMIN);
}
/**
@@ -145,7 +143,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
public function scopeActive(Builder $query)
{
return $query->where('active', true);
return $query->where('active', '=', true);
}
/**

View File

@@ -29,10 +29,14 @@ class ComponentPresenter extends BasePresenter implements Arrayable
public function status_color()
{
switch ($this->wrappedObject->status) {
case 1: return 'greens';
case 2: return 'blues';
case 3: return 'yellows';
case 4: return 'reds';
case 1:
return 'greens';
case 2:
return 'blues';
case 3:
return 'yellows';
case 4:
return 'reds';
}
}

View File

@@ -269,8 +269,6 @@ class IncidentPresenter extends BasePresenter implements Arrayable
public function duration()
{
if ($update = $this->latest()) {
dd($update->created_at->diffInSeconds($this->wrappedObject->created_at));
return $this->wrappedObject->created_at->diffInSeconds($update->created_at);
}

View File

@@ -27,10 +27,14 @@ class MetricPresenter extends BasePresenter implements Arrayable
public function view_name()
{
switch ($this->wrappedObject->default_view) {
case 0: return 'last_hour';
case 1: return 'today';
case 2: return 'week';
case 3: return 'month';
case 0:
return 'last_hour';
case 1:
return 'today';
case 2:
return 'week';
case 3:
return 'month';
}
}
@@ -52,10 +56,14 @@ class MetricPresenter extends BasePresenter implements Arrayable
public function trans_string_name()
{
switch ($this->wrappedObject->default_view) {
case 0: return 'last_hour';
case 1: return 'hourly';
case 2: return 'weekly';
case 3: return 'monthly';
case 0:
return 'last_hour';
case 1:
return 'hourly';
case 2:
return 'weekly';
case 3:
return 'monthly';
}
}

View File

@@ -81,7 +81,7 @@ class Repository
$this->stale = true;
if ($value === null) {
$this->model->where('name', $name)->delete();
$this->model->where('name', '=', $name)->delete();
} else {
$this->model->updateOrCreate(compact('name'), compact('value'));
}
@@ -97,7 +97,7 @@ class Repository
*/
public function get($name, $default = null)
{
if ($setting = $this->model->where('name', $name)->first()) {
if ($setting = $this->model->where('name', '=', $name)->first()) {
return $this->castSetting($name, $setting->value);
}
@@ -115,7 +115,7 @@ class Repository
{
$this->stale = true;
$this->model->where('name', $name)->delete();
$this->model->where('name', '=', $name)->delete();
}
/**

View File

@@ -26,7 +26,7 @@ $app->singleton('Illuminate\Contracts\Http\Kernel', 'CachetHQ\Cachet\Http\Kernel
$app->singleton('Illuminate\Contracts\Console\Kernel', 'CachetHQ\Cachet\Console\Kernel');
$app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'GrahamCampbell\Exceptions\ExceptionHandler');
$app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'GrahamCampbell\Exceptions\NewExceptionHandler');
/*
|--------------------------------------------------------------------------

View File

@@ -1,7 +1,13 @@
{
"name": "cachethq/cachet",
"description": "An open source status page system, for everyone.",
"keywords": ["laravel", "cachet", "alt-three", "status", "page"],
"keywords": [
"laravel",
"cachet",
"alt-three",
"status",
"page"
],
"type": "project",
"license": "BSD-3-Clause",
"authors": [
@@ -19,10 +25,10 @@
}
],
"require": {
"php": ">=5.5.9",
"php": ">=5.6.4",
"ext-xml": "*",
"alt-three/badger": "^3.1",
"alt-three/bus": "^1.1",
"alt-three/bus": "^2.0",
"alt-three/emoji": "^3.1",
"alt-three/throttle": "^1.0",
"alt-three/validator": "^1.5",
@@ -32,29 +38,29 @@
"doctrine/dbal": "^2.5",
"fedeisas/laravel-mail-css-inliner": "^1.5",
"fideloper/proxy": "^3.1",
"graham-campbell/binput": "^3.4",
"graham-campbell/binput": "^3.5",
"graham-campbell/core": "^5.1",
"graham-campbell/exceptions": "^8.6",
"graham-campbell/exceptions": "^9.1",
"graham-campbell/markdown": "^6.1",
"guzzlehttp/guzzle": "^6.2.1",
"jenssegers/date": "^3.2",
"laravel/framework": "5.2.45",
"laravel/framework": "5.3.*",
"mccool/laravel-auto-presenter": "^4.3",
"pragmarx/google2fa": "^0.7.1",
"predis/predis": "^1.1",
"twig/twig": "^2.0.0",
"twig/twig": "^1.26.1",
"roumen/feed": "^2.10.4"
},
"require-dev": {
"alt-three/testbench": "^1.8",
"alt-three/testbench": "^1.9",
"filp/whoops": "^2.1",
"fzaninotto/faker": "^1.6",
"graham-campbell/testbench-core": "^1.1",
"mockery/mockery": "0.9.5",
"phpunit/phpunit": "4.8.21",
"symfony/css-selector": "^3.0",
"symfony/dom-crawler": "^3.0",
"tightenco/mailthief": "^0.2.3"
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "^3.1",
"symfony/dom-crawler": "^3.1",
"tightenco/mailthief": "^0.3.2"
},
"autoload": {
"classmap": [
@@ -94,9 +100,6 @@
]
},
"config": {
"platform": {
"php": "5.5.9"
},
"preferred-install": "dist"
},
"extra": {
@@ -104,6 +107,6 @@
"dev-master": "2.4-dev"
}
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true
}

656
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,18 @@
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
*/
'name' => 'Cachet',
/*
|--------------------------------------------------------------------------
| Application Environment
@@ -147,6 +159,7 @@ return [
'Illuminate\Foundation\Providers\FoundationServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Mail\MailServiceProvider',
Illuminate\Notifications\NotificationServiceProvider::class,
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
@@ -204,35 +217,36 @@ return [
'aliases' => [
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Cache' => 'Illuminate\Support\Facades\Cache',
'Config' => 'Illuminate\Support\Facades\Config',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Gate' => 'Illuminate\Support\Facades\Gate',
'Hash' => 'Illuminate\Support\Facades\Hash',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Cache' => 'Illuminate\Support\Facades\Cache',
'Config' => 'Illuminate\Support\Facades\Config',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Gate' => 'Illuminate\Support\Facades\Gate',
'Hash' => 'Illuminate\Support\Facades\Hash',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Binput' => 'GrahamCampbell\Binput\Facades\Binput',
'Str' => 'Illuminate\Support\Str',

View File

@@ -76,8 +76,13 @@ return [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => 'CachetHQ\Cachet\Models\User',
'model' => \CachetHQ\Cachet\Models\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
@@ -85,10 +90,6 @@ return [
| Resetting Passwords
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You may also set the name of the
| table that maintains all of the reset tokens for your application.
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
@@ -102,7 +103,6 @@ return [
'passwords' => [
'users' => [
'provider' => 'users',
'email' => 'auth.emails.password',
'table' => 'password_resets',
'expire' => 60,
],

View File

@@ -10,7 +10,6 @@
*/
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
@@ -20,10 +19,10 @@ return [
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file", "memcached", "redis"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
@@ -34,46 +33,45 @@ return [
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'),
],
'memcached' => [
'driver' => 'memcached',
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => '127.0.0.1',
'port' => 11211,
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
@@ -84,7 +82,5 @@ return [
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => 'laravel',
];

View File

@@ -44,17 +44,17 @@ return [
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 60,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'ttr' => 60,
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 60,
],
'sqs' => [
@@ -67,10 +67,10 @@ return [
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'expire' => 86400,
'driver' => 'redis',
'connection' => 'default',
'queue' => 'default',
'retry_after' => 86400,
],
],

View File

@@ -17,7 +17,7 @@ return [
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, Mandrill, and others. This file provides a sane
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
|

View File

@@ -94,6 +94,19 @@ return [
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc" or "memcached" session drivers, you may specify a
| cache store that should be used for these sessions. This value must
| correspond with one of the application's configured cache stores.
|
*/
'store' => null,
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
@@ -144,7 +157,7 @@ return [
|
*/
'domain' => null,
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
@@ -157,7 +170,7 @@ return [
|
*/
'secure' => false,
'secure' => env('SESSION_SECURE_COOKIE', false),
/*
|--------------------------------------------------------------------------

27
routes/api.php Executable file
View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/user', function (Request $request) {
return $request->user();
})->middleware('auth:api');

27
routes/console.php Executable file
View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');

15
routes/web.php Executable file
View File

@@ -0,0 +1,15 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Route::get('/', function () {
return view('welcome');
});

View File

@@ -34,7 +34,7 @@ abstract class AbstractTestCase extends TestCase
/**
* Test actor.
*
* @var User
* @var \CachetHQ\Cachet\Models\User
*/
protected $user;
@@ -57,7 +57,7 @@ abstract class AbstractTestCase extends TestCase
*
* @param User|null $user
*
* @return AbstractTestCase
* @return \CachetHQ\Tests\Cachet\AbstractTestCase
*/
protected function signIn(User $user = null)
{
@@ -73,7 +73,7 @@ abstract class AbstractTestCase extends TestCase
*
* @param array $properties
*
* @return User
* @return \CachetHQ\Cachet\Models\User
*/
protected function createUser($properties = [])
{
@@ -83,7 +83,7 @@ abstract class AbstractTestCase extends TestCase
/**
* Set up the needed configuration to be able to run the tests.
*
* @return AbstractTestCase
* @return \CachetHQ\Tests\Cachet\AbstractTestCase
*/
protected function setupConfig()
{

View File

@@ -37,7 +37,10 @@ class AddComponentGroupCommandTest extends AbstractTestCase
];
$object = new AddComponentGroupCommand(
$params['name'], $params['order'], $params['collapsed'], $params['visible']
$params['name'],
$params['order'],
$params['collapsed'],
$params['visible']
);
return compact('params', 'object');

View File

@@ -46,7 +46,7 @@ class ManagerTest extends AbstractTestCase
$manager = m::mock('CachetHQ\Cachet\Services\Modules\Manager[groupModules]');
$manager->shouldReceive('groupModules')->once()->passthru();
$grouped = $manager->groupModules($this->getModules(), $this->getGroups());
$grouped = $manager->groupModules($this->getModules(), $this->getModuleGroups());
$this->assertSame($this->getGroupedModulesWithOrders(), $grouped);
}
@@ -84,7 +84,7 @@ class ManagerTest extends AbstractTestCase
];
}
protected function getGroups()
protected function getModuleGroups()
{
return [
'one' => 1,