Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj committed Sep 1, 2020
1 parent 3dae2e5 commit 3d6f6f1
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -11,5 +11,5 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[{*.yml,yaml}]
[*.{yml,yaml}]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
laravel: [^6.0, ^7.0]
laravel: [^6.0, ^7.0, ^8.0]
include:
- laravel: ^7.0
testbench: ^5.0
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -17,7 +17,7 @@
"require": {
"php": "^7.2",
"ext-json": "*",
"laravel/framework": "^6.0|^7.0"
"laravel/framework": "^6.0|^7.0|^8.0"
},
"require-dev": {
"mockery/mockery": "^1.3|^1.4",
Expand Down
100 changes: 56 additions & 44 deletions src/CanvasServiceProvider.php
Expand Up @@ -16,39 +16,30 @@
class CanvasServiceProvider extends ServiceProvider
{
/**
* Bootstrap any package services.
* Register any application services.
*
* @return void
* @throws BindingResolutionException
*/
public function boot()
public function register()
{
$this->registerEvents();
$this->registerRoutes();
$this->registerMigrations();
$this->registerPublishing();
$this->loadViewsFrom(__DIR__.'/../resources/views', 'canvas');
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'canvas');
$this->mergeConfigFrom(__DIR__.'/../config/canvas.php', 'canvas');
}

/**
* Register bindings in the container.
* Bootstrap any application services.
*
* @return void
* @throws BindingResolutionException
*/
public function register()
public function boot()
{
$this->mergeConfigFrom(
__DIR__.'/../config/canvas.php',
'canvas'
);

$this->commands([
AdminCommand::class,
DigestCommand::class,
InstallCommand::class,
PublishCommand::class,
]);
$this->loadViewsFrom(__DIR__.'/../resources/views', 'canvas');
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'canvas');
$this->configurePublishing();
$this->configureRoutes();
$this->configureCommands();
$this->registerMigrations();
$this->registerEvents();
}

/**
Expand Down Expand Up @@ -76,15 +67,34 @@ private function registerEvents()
}

/**
* Register the package routes.
* Configure the routes offered by the application.
*
* @return void
*/
private function registerRoutes()
private function configureRoutes()
{
$this->loadRoutesFrom(__DIR__.'/Http/routes.php');
}

/**
* Configure the commands offered by the application.
*
* @return void
*/
protected function configureCommands()
{
if (! $this->app->runningInConsole()) {
return;
}

$this->commands([
AdminCommand::class,
DigestCommand::class,
InstallCommand::class,
PublishCommand::class,
]);
}

/**
* Register the package's migrations.
*
Expand All @@ -98,30 +108,32 @@ private function registerMigrations()
}

/**
* Register the package's publishable resources.
* Configure publishing for the package.
*
* @return void
*/
private function registerPublishing()
private function configurePublishing()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../public' => public_path('vendor/canvas'),
], 'canvas-assets');

$this->publishes([
__DIR__.'/../config/canvas.php' => config_path('canvas.php'),
], 'canvas-config');

$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/canvas'),
], 'canvas-lang');

$this->publishes([
__DIR__.'/../resources/stubs/CanvasServiceProvider.stub' => app_path(
'Providers/CanvasServiceProvider.php'
),
], 'canvas-provider');
if (! $this->app->runningInConsole()) {
return;
}

$this->publishes([
__DIR__.'/../public' => public_path('vendor/canvas'),
], 'canvas-assets');

$this->publishes([
__DIR__.'/../config/canvas.php' => config_path('canvas.php'),
], 'canvas-config');

$this->publishes([
__DIR__.'/../resources/lang' => resource_path('lang/vendor/canvas'),
], 'canvas-lang');

$this->publishes([
__DIR__.'/../resources/stubs/CanvasServiceProvider.stub' => app_path(
'Providers/CanvasServiceProvider.php'
),
], 'canvas-provider');
}
}
18 changes: 9 additions & 9 deletions yarn.lock
Expand Up @@ -1786,9 +1786,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001111:
version "1.0.30001120"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001120.tgz#cd21d35e537214e19f7b9f4f161f7b0f2710d46c"
integrity sha512-JBP68okZs1X8D7MQTY602jxMYBmXEKOFkzTBaNSkubooMPFOAv2TXWaKle7qgHpjLDhUzA/TMT0qsNleVyXGUQ==
version "1.0.30001122"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001122.tgz#2c8ff631330d986a07a7ba7125cce77a1373b475"
integrity sha512-pxjw28CThdrqfz06nJkpAc5SXM404TXB/h5f4UJX+rrXJKE/1bu/KAILc2AY+O6cQIFtRjV9qOR2vaEp9LDGUA==

chalk@^1.1.3:
version "1.1.3"
Expand Down Expand Up @@ -2721,9 +2721,9 @@ ejs@^2.6.1:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==

electron-to-chromium@^1.3.523:
version "1.3.555"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.555.tgz#a096716ff77cf8da9a608eb628fd6927869503d2"
integrity sha512-/55x3nF2feXFZ5tdGUOr00TxnUjUgdxhrn+eCJ1FAcoAt+cKQTjQkUC5XF4frMWE1R5sjHk+JueuBalimfe5Pg==
version "1.3.556"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.556.tgz#d2a8fed6b93051c5c27d182c43c7bc4d88b77afb"
integrity sha512-g5cGpg6rOCXxyfaLCQIWz9Fx+raFfbZ6sc4QLfvvaiCERBzY6YD6rh5d12QN++bEF1Tm9osYnxP37lbN/92j4A==

elliptic@^6.5.3:
version "6.5.3"
Expand Down Expand Up @@ -5643,9 +5643,9 @@ posix-character-classes@^0.1.0:
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

postcss-calc@^7.0.1:
version "7.0.3"
resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.3.tgz#d65cca92a3c52bf27ad37a5f732e0587b74f1623"
integrity sha512-IB/EAEmZhIMEIhG7Ov4x+l47UaXOS1n2f4FBUk/aKllQhtSCxWhTzn0nJgkqN7fo/jcWySvWTSB6Syk9L+31bA==
version "7.0.4"
resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.4.tgz#5e177ddb417341e6d4a193c5d9fd8ada79094f8b"
integrity sha512-0I79VRAd1UTkaHzY9w83P39YGO/M3bG7/tNLrHGEunBolfoGM0hSjrGvjoeaj0JE/zIw5GsI2KZ0UwDJqv5hjw==
dependencies:
postcss "^7.0.27"
postcss-selector-parser "^6.0.2"
Expand Down

0 comments on commit 3d6f6f1

Please sign in to comment.