Skip to content

Commit

Permalink
add timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
uyab committed Dec 15, 2015
1 parent 7a5e887 commit 5ceb0fb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Contracts/TimezoneRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Laravolt\Support\Contracts;


/**
* Interface TimezoneRepository
* @package namespace App\Repositories;
*/
interface TimezoneRepository
{
public function lists();
}
18 changes: 18 additions & 0 deletions src/Repositories/TimezoneRepositoryArray.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Laravolt\Support\Repositories;

use Laravolt\Support\Contracts\TimezoneRepository;

/**
* Class TimezoneRepositoryEloquent
* @package namespace App\Repositories;
*/
class TimezoneRepositoryArray implements TimezoneRepository
{
public function lists()
{
return array_flip(config('timezones'));
}

}
3 changes: 3 additions & 0 deletions src/SupportServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public function register()
// activity log
$this->app->register('Spatie\Activitylog\ActivitylogServiceProvider');
AliasLoader::getInstance()->alias('Activity', 'Spatie\Activitylog\ActivitylogFacade');

// timezone
$this->app->bind(Contracts\TimezoneRepository::class, Repositories\TimezoneRepositoryArray::class);
}

/**
Expand Down
13 changes: 13 additions & 0 deletions src/TimezoneRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Repositories;


/**
* Interface TimezoneRepository
* @package namespace App\Repositories;
*/
interface TimezoneRepository
{
public function lists();
}

0 comments on commit 5ceb0fb

Please sign in to comment.