WalletServiceProvider.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // Copyright 2019 Hackware SpA <human@hackware.cl>
  3. // This file is part of "Hackware Web Services Wallet" and licensed under
  4. // the terms of the GNU Affero General Public License version 3, or (at your
  5. // option) a later version. You should have received a copy of this license
  6. // along with the software. If not, see <https://www.gnu.org/licenses/>.
  7. namespace Hawese\Wallet\Providers;
  8. use Illuminate\Support\ServiceProvider;
  9. class WalletServiceProvider extends ServiceProvider
  10. {
  11. const BASEDIR = __DIR__ . '/../..';
  12. public function register()
  13. {
  14. $this->mergeConfigFrom(
  15. self::BASEDIR . '/config/wallet.php',
  16. 'wallet'
  17. );
  18. }
  19. public function boot()
  20. {
  21. $this->loadRoutesFrom(self::BASEDIR . '/routes/wallet.php');
  22. $this->loadMigrationsFrom(self::BASEDIR . '/database/migrations');
  23. $this->loadViewsFrom(self::BASEDIR . '/resources/views', 'wallet');
  24. // Policies
  25. $this->app['gate']->policy(
  26. Hawese\Wallet\Wallet::class,
  27. Hawese\Wallet\Policies\WalletPolicy::class
  28. );
  29. $this->app['gate']->policy(
  30. Hawese\Wallet\Transaction::class,
  31. Hawese\Wallet\Policies\TransactionPolicy::class
  32. );
  33. }
  34. }