Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#19)
by Owen
02:03
created
src/database/migrations/2015_08_04_131614_create_settings_table.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('settings', function (Blueprint $table) {
15
+        Schema::create('settings', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('key');
18 18
             $table->string('name');
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,32 +5,32 @@
 block discarded – undo
5 5
 
6 6
 class CreateSettingsTable extends Migration
7 7
 {
8
-    /**
9
-     * Run the migrations.
10
-     *
11
-     * @return void
12
-     */
13
-    public function up()
14
-    {
15
-        Schema::create('settings', function (Blueprint $table) {
16
-            $table->increments('id');
17
-            $table->string('key');
18
-            $table->string('name');
19
-            $table->string('description')->nullable();
20
-            $table->string('value')->nullable();
21
-            $table->text('field');
22
-            $table->tinyInteger('active');
23
-            $table->timestamps();
24
-        });
25
-    }
8
+	/**
9
+	 * Run the migrations.
10
+	 *
11
+	 * @return void
12
+	 */
13
+	public function up()
14
+	{
15
+		Schema::create('settings', function (Blueprint $table) {
16
+			$table->increments('id');
17
+			$table->string('key');
18
+			$table->string('name');
19
+			$table->string('description')->nullable();
20
+			$table->string('value')->nullable();
21
+			$table->text('field');
22
+			$table->tinyInteger('active');
23
+			$table->timestamps();
24
+		});
25
+	}
26 26
 
27
-    /**
28
-     * Reverse the migrations.
29
-     *
30
-     * @return void
31
-     */
32
-    public function down()
33
-    {
34
-        Schema::drop('settings');
35
-    }
27
+	/**
28
+	 * Reverse the migrations.
29
+	 *
30
+	 * @return void
31
+	 */
32
+	public function down()
33
+	{
34
+		Schema::drop('settings');
35
+	}
36 36
 }
Please login to merge, or discard this patch.
src/app/Http/Controllers/SettingCrudController.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Backpack\CRUD\app\Http\Controllers\CrudController;
6 6
 // VALIDATION
7
-use Backpack\Settings\app\Http\Requests\SettingRequest as StoreRequest;
8 7
 use Backpack\Settings\app\Http\Requests\SettingRequest as UpdateRequest;
9 8
 
10 9
 class SettingCrudController extends CrudController
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
         $this->crud->hasAccessOrFail('update');
65 65
 
66 66
         $this->data['entry'] = $this->crud->getEntry($id);
67
-        $this->crud->addField((array) json_decode($this->data['entry']->field)); // <---- this is where it's different
67
+        $this->crud->addField((array)json_decode($this->data['entry']->field)); // <---- this is where it's different
68 68
         $this->data['crud'] = $this->crud;
69 69
         $this->data['fields'] = $this->crud->getUpdateFields($id);
70 70
         $this->data['title'] = trans('backpack::crud.edit').' '.$this->crud->entity_name;
Please login to merge, or discard this patch.
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -9,76 +9,76 @@
 block discarded – undo
9 9
 
10 10
 class SettingCrudController extends CrudController
11 11
 {
12
-    public function __construct()
13
-    {
14
-        parent::__construct();
12
+	public function __construct()
13
+	{
14
+		parent::__construct();
15 15
 
16
-        $this->crud->setModel("Backpack\Settings\app\Models\Setting");
17
-        $this->crud->setEntityNameStrings('setting', 'settings');
18
-        $this->crud->setRoute(config('backpack.base.route_prefix', 'admin').'/setting');
19
-        $this->crud->denyAccess(['create', 'delete']);
20
-        $this->crud->setColumns(['name', 'value', 'description']);
21
-        $this->crud->addField([
22
-                                'name'       => 'name',
23
-                                'label'      => 'Name',
24
-                                'type'       => 'text',
25
-                                'attributes' => [
26
-                                    'disabled' => 'disabled',
27
-                                    ],
28
-                            ]);
29
-    }
16
+		$this->crud->setModel("Backpack\Settings\app\Models\Setting");
17
+		$this->crud->setEntityNameStrings('setting', 'settings');
18
+		$this->crud->setRoute(config('backpack.base.route_prefix', 'admin').'/setting');
19
+		$this->crud->denyAccess(['create', 'delete']);
20
+		$this->crud->setColumns(['name', 'value', 'description']);
21
+		$this->crud->addField([
22
+								'name'       => 'name',
23
+								'label'      => 'Name',
24
+								'type'       => 'text',
25
+								'attributes' => [
26
+									'disabled' => 'disabled',
27
+									],
28
+							]);
29
+	}
30 30
 
31
-    /**
32
-     * Display all rows in the database for this entity.
33
-     * This overwrites the default CrudController behaviour:
34
-     * - instead of showing all entries, only show the "active" ones.
35
-     *
36
-     * @return Response
37
-     */
38
-    public function index()
39
-    {
40
-        // if view_table_permission is false, abort
41
-        $this->crud->hasAccessOrFail('list');
42
-        $this->crud->addClause('where', 'active', 1); // <---- this is where it's different from CrudController::index()
31
+	/**
32
+	 * Display all rows in the database for this entity.
33
+	 * This overwrites the default CrudController behaviour:
34
+	 * - instead of showing all entries, only show the "active" ones.
35
+	 *
36
+	 * @return Response
37
+	 */
38
+	public function index()
39
+	{
40
+		// if view_table_permission is false, abort
41
+		$this->crud->hasAccessOrFail('list');
42
+		$this->crud->addClause('where', 'active', 1); // <---- this is where it's different from CrudController::index()
43 43
 
44
-        $this->data['entries'] = $this->crud->getEntries();
45
-        $this->data['crud'] = $this->crud;
46
-        $this->data['title'] = ucfirst($this->crud->entity_name_plural);
44
+		$this->data['entries'] = $this->crud->getEntries();
45
+		$this->data['crud'] = $this->crud;
46
+		$this->data['title'] = ucfirst($this->crud->entity_name_plural);
47 47
 
48
-        // load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package
49
-        return view('crud::list', $this->data);
50
-    }
48
+		// load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package
49
+		return view('crud::list', $this->data);
50
+	}
51 51
 
52
-    public function store(StoreRequest $request)
53
-    {
54
-        return parent::storeCrud();
55
-    }
52
+	public function store(StoreRequest $request)
53
+	{
54
+		return parent::storeCrud();
55
+	}
56 56
 
57
-    /**
58
-     * Show the form for editing the specified resource.
59
-     *
60
-     * @param int $id
61
-     *
62
-     * @return Response
63
-     */
64
-    public function edit($id)
65
-    {
66
-        $this->crud->hasAccessOrFail('update');
57
+	/**
58
+	 * Show the form for editing the specified resource.
59
+	 *
60
+	 * @param int $id
61
+	 *
62
+	 * @return Response
63
+	 */
64
+	public function edit($id)
65
+	{
66
+		$this->crud->hasAccessOrFail('update');
67 67
 
68
-        $this->data['entry'] = $this->crud->getEntry($id);
69
-        $this->crud->addField((array) json_decode($this->data['entry']->field)); // <---- this is where it's different
70
-        $this->data['crud'] = $this->crud;
71
-        $this->data['fields'] = $this->crud->getUpdateFields($id);
72
-        $this->data['title'] = trans('backpack::crud.edit').' '.$this->crud->entity_name;
68
+		$this->data['entry'] = $this->crud->getEntry($id);
69
+		$this->crud->addField((array) json_decode($this->data['entry']->field)); // <---- this is where it's different
70
+		$this->data['crud'] = $this->crud;
71
+		$this->data['fields'] = $this->crud->getUpdateFields($id);
72
+		$this->data['title'] = trans('backpack::crud.edit').' '.$this->crud->entity_name;
73 73
 
74
-        $this->data['id'] = $id;
74
+		$this->data['id'] = $id;
75 75
 
76
-        // load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package
77
-        return view('crud::edit', $this->data);
78
-    }
76
+		// load the view from /resources/views/vendor/backpack/crud/ if it exists, otherwise load the one in the package
77
+		return view('crud::edit', $this->data);
78
+	}
79 79
 
80
-    public function update(UpdateRequest $request)
81
-    {
82
-        return parent::updateCrud();
83
-    }
80
+	public function update(UpdateRequest $request)
81
+	{
82
+		return parent::updateCrud();
83
+	}
84 84
 }
Please login to merge, or discard this patch.
src/app/Http/Requests/SettingRequest.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,28 +6,28 @@
 block discarded – undo
6 6
 
7 7
 class SettingRequest extends Request
8 8
 {
9
-    /**
10
-     * Determine if the user is authorized to make this request.
11
-     *
12
-     * @return bool
13
-     */
14
-    public function authorize()
15
-    {
16
-        // only allow updates if the user is logged in
17
-        return \Auth::check();
18
-    }
9
+	/**
10
+	 * Determine if the user is authorized to make this request.
11
+	 *
12
+	 * @return bool
13
+	 */
14
+	public function authorize()
15
+	{
16
+		// only allow updates if the user is logged in
17
+		return \Auth::check();
18
+	}
19 19
 
20
-    /**
21
-     * Get the validation rules that apply to the request.
22
-     *
23
-     * @return array
24
-     */
25
-    public function rules()
26
-    {
27
-        return [
28
-            // 'key' => 'required|min:3|max:255',
29
-            // 'name' => 'required|min:3|max:255',
30
-            // 'field' => 'required'
31
-        ];
32
-    }
20
+	/**
21
+	 * Get the validation rules that apply to the request.
22
+	 *
23
+	 * @return array
24
+	 */
25
+	public function rules()
26
+	{
27
+		return [
28
+			// 'key' => 'required|min:3|max:255',
29
+			// 'name' => 'required|min:3|max:255',
30
+			// 'field' => 'required'
31
+		];
32
+	}
33 33
 }
Please login to merge, or discard this patch.
src/app/Models/Setting.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 
8 8
 class Setting extends Model
9 9
 {
10
-    use CrudTrait;
10
+	use CrudTrait;
11 11
 
12
-    protected $table = 'settings';
13
-    protected $fillable = ['value'];
12
+	protected $table = 'settings';
13
+	protected $fillable = ['value'];
14 14
 }
Please login to merge, or discard this patch.
src/database/seeds/SettingsTableSeeder.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -7,50 +7,50 @@
 block discarded – undo
7 7
 
8 8
 class SettingsTableSeeder extends Seeder
9 9
 {
10
-    /**
11
-     * Run the database seeds.
12
-     *
13
-     * @return void
14
-     */
15
-    public function run()
16
-    {
17
-        DB::table('settings')->insert([
18
-            'key'           => 'contact_email',
19
-            'name'          => 'Contact form email address',
20
-            'description'   => 'The email address that all emails from the contact form will go to.',
21
-            'value'         => '[email protected]',
22
-            'field'         => '{"name":"value","label":"Value","type":"email"}',
23
-            'active'        => 1,
24
-        ]);
25
-
26
-        DB::table('settings')->insert([
27
-            'key'           => 'contact_cc',
28
-            'name'          => 'Contact form CC field',
29
-            'description'   => 'Email adresses separated by comma, to be included as CC in the email sent by the contact form.',
30
-            'value'         => '',
31
-            'field'         => '{"name":"value","label":"Value","type":"email"}',
32
-            'active'        => 1,
33
-
34
-        ]);
35
-
36
-        DB::table('settings')->insert([
37
-            'key'           => 'contact_bcc',
38
-            'name'          => 'Contact form BCC field',
39
-            'description'   => 'Email adresses separated by comma, to be included as BCC in the email sent by the contact form.',
40
-            'value'         => '',
41
-            'field'         => '{"name":"value","label":"Value","type":"email"}',
42
-            'active'        => 1,
43
-
44
-        ]);
45
-
46
-        DB::table('settings')->insert([
47
-            'key'           => 'motto',
48
-            'name'          => 'Motto',
49
-            'description'   => 'Website motto',
50
-            'value'         => 'this is the value',
51
-            'field'         => '{"name":"value","label":"Value", "title":"Motto value" ,"type":"textarea"}',
52
-            'active'        => 1,
53
-
54
-        ]);
55
-    }
10
+	/**
11
+	 * Run the database seeds.
12
+	 *
13
+	 * @return void
14
+	 */
15
+	public function run()
16
+	{
17
+		DB::table('settings')->insert([
18
+			'key'           => 'contact_email',
19
+			'name'          => 'Contact form email address',
20
+			'description'   => 'The email address that all emails from the contact form will go to.',
21
+			'value'         => '[email protected]',
22
+			'field'         => '{"name":"value","label":"Value","type":"email"}',
23
+			'active'        => 1,
24
+		]);
25
+
26
+		DB::table('settings')->insert([
27
+			'key'           => 'contact_cc',
28
+			'name'          => 'Contact form CC field',
29
+			'description'   => 'Email adresses separated by comma, to be included as CC in the email sent by the contact form.',
30
+			'value'         => '',
31
+			'field'         => '{"name":"value","label":"Value","type":"email"}',
32
+			'active'        => 1,
33
+
34
+		]);
35
+
36
+		DB::table('settings')->insert([
37
+			'key'           => 'contact_bcc',
38
+			'name'          => 'Contact form BCC field',
39
+			'description'   => 'Email adresses separated by comma, to be included as BCC in the email sent by the contact form.',
40
+			'value'         => '',
41
+			'field'         => '{"name":"value","label":"Value","type":"email"}',
42
+			'active'        => 1,
43
+
44
+		]);
45
+
46
+		DB::table('settings')->insert([
47
+			'key'           => 'motto',
48
+			'name'          => 'Motto',
49
+			'description'   => 'Website motto',
50
+			'value'         => 'this is the value',
51
+			'field'         => '{"name":"value","label":"Value", "title":"Motto value" ,"type":"textarea"}',
52
+			'active'        => 1,
53
+
54
+		]);
55
+	}
56 56
 }
Please login to merge, or discard this patch.
src/SettingsServiceProvider.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -11,78 +11,78 @@
 block discarded – undo
11 11
 
12 12
 class SettingsServiceProvider extends ServiceProvider
13 13
 {
14
-    /**
15
-     * Indicates if loading of the provider is deferred.
16
-     *
17
-     * @var bool
18
-     */
19
-    protected $defer = false;
14
+	/**
15
+	 * Indicates if loading of the provider is deferred.
16
+	 *
17
+	 * @var bool
18
+	 */
19
+	protected $defer = false;
20 20
 
21
-    /**
22
-     * Perform post-registration booting of services.
23
-     *
24
-     * @return void
25
-     */
26
-    public function boot()
27
-    {
28
-        if (! \App::runningInConsole()) {
29
-            // only use the Settings package if the Settings table is present in the database
30
-            if (count(Schema::getColumnListing('settings'))) {
31
-                // get all settings from the database
32
-                $settings = Setting::all();
21
+	/**
22
+	 * Perform post-registration booting of services.
23
+	 *
24
+	 * @return void
25
+	 */
26
+	public function boot()
27
+	{
28
+		if (! \App::runningInConsole()) {
29
+			// only use the Settings package if the Settings table is present in the database
30
+			if (count(Schema::getColumnListing('settings'))) {
31
+				// get all settings from the database
32
+				$settings = Setting::all();
33 33
 
34
-                // bind all settings to the Laravel config, so you can call them like
35
-                // Config::get('settings.contact_email')
36
-                foreach ($settings as $key => $setting) {
37
-                    Config::set('settings.'.$setting->key, $setting->value);
38
-                }
39
-            }
34
+				// bind all settings to the Laravel config, so you can call them like
35
+				// Config::get('settings.contact_email')
36
+				foreach ($settings as $key => $setting) {
37
+					Config::set('settings.'.$setting->key, $setting->value);
38
+				}
39
+			}
40 40
 
41
-            // publish the migrations and seeds
42
-            $this->publishes([__DIR__.'/database/migrations/' => database_path('migrations')], 'migrations');
43
-            $this->publishes([__DIR__.'/database/seeds/' => database_path('seeds')], 'seeds');
44
-        }
45
-    }
41
+			// publish the migrations and seeds
42
+			$this->publishes([__DIR__.'/database/migrations/' => database_path('migrations')], 'migrations');
43
+			$this->publishes([__DIR__.'/database/seeds/' => database_path('seeds')], 'seeds');
44
+		}
45
+	}
46 46
 
47
-    /**
48
-     * Define the routes for the application.
49
-     *
50
-     * @param \Illuminate\Routing\Router $router
51
-     *
52
-     * @return void
53
-     */
54
-    public function setupRoutes(Router $router)
55
-    {
56
-        $router->group(['namespace' => 'Backpack\Settings\app\Http\Controllers'], function ($router) {
57
-            // Admin Interface Routes
58
-            Route::group(['prefix'   => config('backpack.base.route_prefix', 'admin'),
59
-                        'middleware' => ['web', 'admin'], ], function () {
60
-                            // Settings
61
-                            Route::resource('setting', 'SettingCrudController');
62
-                        });
63
-        });
64
-    }
47
+	/**
48
+	 * Define the routes for the application.
49
+	 *
50
+	 * @param \Illuminate\Routing\Router $router
51
+	 *
52
+	 * @return void
53
+	 */
54
+	public function setupRoutes(Router $router)
55
+	{
56
+		$router->group(['namespace' => 'Backpack\Settings\app\Http\Controllers'], function ($router) {
57
+			// Admin Interface Routes
58
+			Route::group(['prefix'   => config('backpack.base.route_prefix', 'admin'),
59
+						'middleware' => ['web', 'admin'], ], function () {
60
+							// Settings
61
+							Route::resource('setting', 'SettingCrudController');
62
+						});
63
+		});
64
+	}
65 65
 
66
-    /**
67
-     * Register any package services.
68
-     *
69
-     * @return void
70
-     */
71
-    public function register()
72
-    {
73
-        $this->registerSettings();
74
-        $this->setupRoutes($this->app->router);
66
+	/**
67
+	 * Register any package services.
68
+	 *
69
+	 * @return void
70
+	 */
71
+	public function register()
72
+	{
73
+		$this->registerSettings();
74
+		$this->setupRoutes($this->app->router);
75 75
 
76
-        // use this if your package has a config file
77
-        // config([
78
-        //         'config/Settings.php',
79
-        // ]);
80
-    }
76
+		// use this if your package has a config file
77
+		// config([
78
+		//         'config/Settings.php',
79
+		// ]);
80
+	}
81 81
 
82
-    private function registerSettings()
83
-    {
84
-        $this->app->bind('settings', function ($app) {
85
-            return new Settings($app);
86
-        });
87
-    }
82
+	private function registerSettings()
83
+	{
84
+		$this->app->bind('settings', function ($app) {
85
+			return new Settings($app);
86
+		});
87
+	}
88 88
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function boot()
27 27
     {
28
-        if (! \App::runningInConsole()) {
28
+        if (!\App::runningInConsole()) {
29 29
             // only use the Settings package if the Settings table is present in the database
30 30
             if (count(Schema::getColumnListing('settings'))) {
31 31
                 // get all settings from the database
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function setupRoutes(Router $router)
55 55
     {
56
-        $router->group(['namespace' => 'Backpack\Settings\app\Http\Controllers'], function ($router) {
56
+        $router->group(['namespace' => 'Backpack\Settings\app\Http\Controllers'], function($router) {
57 57
             // Admin Interface Routes
58 58
             Route::group(['prefix'   => config('backpack.base.route_prefix', 'admin'),
59
-                        'middleware' => ['web', 'admin'], ], function () {
59
+                        'middleware' => ['web', 'admin'], ], function() {
60 60
                             // Settings
61 61
                             Route::resource('setting', 'SettingCrudController');
62 62
                         });
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     private function registerSettings()
83 83
     {
84
-        $this->app->bind('settings', function ($app) {
84
+        $this->app->bind('settings', function($app) {
85 85
             return new Settings($app);
86 86
         });
87 87
     }
Please login to merge, or discard this patch.