Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed May 9, 2019
1 parent 6b3be1f commit fcae206
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/vendor
/node_modules
package-lock.json
composer.lock
.phpunit.result.cache
/vendor
.DS_Store
.phpunit.result.cache
composer.lock
package-lock.json
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to `nova-settings-tool` will be documented in this file.

## 0.3.0 – 2019-04-09
## 0.2.1 – 2019-04-09

- Add `textarea` setting type ([#11](https://github.com/bakerkretzmar/nova-settings-tool/pull/11))
- Fix bug translating the "Settings saved!" message
Expand Down
17 changes: 15 additions & 2 deletions src/Http/Controllers/SettingsToolController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@
namespace Bakerkretzmar\SettingsTool\Http\Controllers;

use Illuminate\Http\Request;
use Spatie\Valuestore\Valuestore;
use Illuminate\Routing\Controller;

use Spatie\Valuestore\Valuestore;

class SettingsToolController extends Controller
{
/** @var string */
/**
* Path to the settings file on disk.
* @var string
*/
protected $settingsPath;

/**
* Create a new controller instance.
*/
public function __construct(string $settingsPath = null)
{
$this->settingsPath = $settingsPath ?? storage_path(config('settings.path', 'app/settings.json'));
}

/**
* Retrieve and format settings from a file.
*/
public function read(Request $request)
{
$settings = Valuestore::make($this->settingsPath)->all();
Expand All @@ -36,6 +46,9 @@ public function read(Request $request)
]);
}

/**
* Save updated settings to a file.
*/
public function write(Request $request)
{
$settings = Valuestore::make($this->settingsPath);
Expand Down
4 changes: 0 additions & 4 deletions src/Http/Middleware/Authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ class Authorize
{
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response
*/
public function handle($request, $next)
{
Expand Down
4 changes: 0 additions & 4 deletions src/SettingsTool.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public function __construct(string $title = null)

/**
* Perform any tasks that need to happen when the tool is booted.
*
* @return void
*/
public function boot()
{
Expand All @@ -24,8 +22,6 @@ public function boot()

/**
* Build the view that renders the navigation links for the tool.
*
* @return \Illuminate\View\View
*/
public function renderNavigation()
{
Expand Down
12 changes: 5 additions & 7 deletions src/SettingsToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

namespace Bakerkretzmar\SettingsTool;

use Laravel\Nova\Nova;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Bakerkretzmar\SettingsTool\Http\Middleware\Authorize;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Route;

use Laravel\Nova\Nova;

class SettingsToolServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Expand All @@ -29,8 +29,6 @@ public function boot()

/**
* Register the tool's routes.
*
* @return void
*/
protected function routes()
{
Expand Down
4 changes: 1 addition & 3 deletions tests/SettingsToolControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class SettingsToolControllerTest extends TestCase
{

public function setUp()
{
parent::setUp();
Expand Down Expand Up @@ -55,7 +54,7 @@ public function it_will_start_from_the_ending_of_the_file_when_no_starting_line_
// 'text' => '',
// 'lastRetrievedLineNumber' => 10,
// ]);

$this->assertTrue(true);
}

Expand All @@ -77,5 +76,4 @@ public function it_can_start_from_a_specific_line()
// SettingsToolServiceProvider::class,
// ];
// }

}
3 changes: 1 addition & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Bakerkretzmar\SettingsTool\Tests;

use Bakerkretzmar\SettingsTool\SettingsToolServiceProvider;

use Illuminate\Support\Facades\Route;

use Orchestra\Testbench\TestCase as Orchestra;

abstract class TestCase extends Orchestra
{

public function setUp()
{
parent::setUp();
Expand All @@ -23,5 +23,4 @@ protected function getPackageProviders($app)
SettingsToolServiceProvider::class,
];
}

}
2 changes: 1 addition & 1 deletion webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ let mix = require('laravel-mix')
mix.disableSuccessNotifications()

mix.setPublicPath('dist')
.js('resources/js/tool.js', 'js')
.js('resources/js/tool.js', 'js')

0 comments on commit fcae206

Please sign in to comment.