Browse Source

Apply fixes from StyleCI (#8)

pull/14/head
Nafies Luthfi 8 years ago
committed by GitHub
parent
commit
1867008620
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      config/app.php
  2. 4
      database/factories/ModelFactory.php
  3. 78
      resources/lang/en/validation.php
  4. 4
      resources/lang/id/backup.php
  5. 6
      resources/lang/id/product.php
  6. 2
      resources/lang/id/unit.php
  7. 16
      resources/lang/id/user.php
  8. 6
      routes/web.php
  9. 4
      tests/Feature/Cart/CartControllerTest.php
  10. 6
      tests/Feature/Cart/SearchProductsTest.php

8
config/app.php

@ -231,10 +231,10 @@ return [
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => Collective\Html\FormFacade::class,
'FormField' => Luthfi\FormField\FormFieldFacade::class,
'PDF' => Barryvdh\DomPDF\Facade::class,
'Html' => Collective\Html\HtmlFacade::class,
'Form' => Collective\Html\FormFacade::class,
'FormField' => Luthfi\FormField\FormFieldFacade::class,
'PDF' => Barryvdh\DomPDF\Facade::class,
'Html' => Collective\Html\HtmlFacade::class,
],
];

4
database/factories/ModelFactory.php

@ -13,8 +13,8 @@ $factory->define(App\User::class, function (Faker\Generator $faker) {
/* @var \Illuminate\Database\Eloquent\Factory $factory */
$factory->define(App\Product::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'unit_id' => function () {
'name' => $faker->name,
'unit_id' => function () {
return factory(App\Unit::class)->create()->id;
},
'cash_price' => 2000,

78
resources/lang/en/validation.php

@ -13,50 +13,50 @@ return [
|
*/
'accepted' => 'The :attribute must be accepted.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
'alpha' => 'The :attribute may only contain letters.',
'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
'alpha_num' => 'The :attribute may only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
'between' => [
'accepted' => 'The :attribute must be accepted.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
'alpha' => 'The :attribute may only contain letters.',
'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
'alpha_num' => 'The :attribute may only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
'between' => [
'numeric' => 'The :attribute must be between :min and :max.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
'string' => 'The :attribute must be between :min and :max characters.',
'array' => 'The :attribute must have between :min and :max items.',
],
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
'date' => 'The :attribute is not a valid date.',
'date_format' => 'The :attribute does not match the format :format.',
'different' => 'The :attribute and :other must be different.',
'digits' => 'The :attribute must be :digits digits.',
'digits_between' => 'The :attribute must be between :min and :max digits.',
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
'in_array' => 'The :attribute field does not exist in :other.',
'integer' => 'The :attribute must be an integer.',
'ip' => 'The :attribute must be a valid IP address.',
'json' => 'The :attribute must be a valid JSON string.',
'max' => [
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
'date' => 'The :attribute is not a valid date.',
'date_format' => 'The :attribute does not match the format :format.',
'different' => 'The :attribute and :other must be different.',
'digits' => 'The :attribute must be :digits digits.',
'digits_between' => 'The :attribute must be between :min and :max digits.',
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
'in_array' => 'The :attribute field does not exist in :other.',
'integer' => 'The :attribute must be an integer.',
'ip' => 'The :attribute must be a valid IP address.',
'json' => 'The :attribute must be a valid JSON string.',
'max' => [
'numeric' => 'The :attribute may not be greater than :max.',
'file' => 'The :attribute may not be greater than :max kilobytes.',
'string' => 'The :attribute may not be greater than :max characters.',
'array' => 'The :attribute may not have more than :max items.',
],
'mimes' => 'The :attribute must be a file of type: :values.',
'mimetypes' => 'The :attribute must be a file of type: :values.',
'min' => [
'mimes' => 'The :attribute must be a file of type: :values.',
'mimetypes' => 'The :attribute must be a file of type: :values.',
'min' => [
'numeric' => 'The :attribute must be at least :min.',
'file' => 'The :attribute must be at least :min kilobytes.',
'string' => 'The :attribute must be at least :min characters.',
@ -80,11 +80,11 @@ return [
'string' => 'The :attribute must be :size characters.',
'array' => 'The :attribute must contain :size items.',
],
'string' => 'The :attribute must be a string.',
'timezone' => 'The :attribute must be a valid zone.',
'unique' => 'The :attribute has already been taken.',
'uploaded' => 'The :attribute failed to upload.',
'url' => 'The :attribute format is invalid.',
'string' => 'The :attribute must be a string.',
'timezone' => 'The :attribute must be a valid zone.',
'unique' => 'The :attribute has already been taken.',
'uploaded' => 'The :attribute failed to upload.',
'url' => 'The :attribute format is invalid.',
/*
|--------------------------------------------------------------------------

4
resources/lang/id/backup.php

@ -2,8 +2,8 @@
return [
// Labels
'index_title' => 'Database Backup Manager',
'list' => 'Backup File List',
'index_title' => 'Database Backup Manager',
'list' => 'Backup File List',
// Actions
'create' => 'Create Backup File',

6
resources/lang/id/product.php

@ -31,7 +31,7 @@ return [
'undeleteable' => 'Data Produk tidak dapat dihapus.',
// Attributes
'name' => 'Nama Produk',
'cash_price' => 'Harga Tunai',
'credit_price' => 'Harga Kredit',
'name' => 'Nama Produk',
'cash_price' => 'Harga Tunai',
'credit_price' => 'Harga Kredit',
];

2
resources/lang/id/unit.php

@ -22,5 +22,5 @@ return [
'undeleteable' => 'Data Satuan tidak dapat dihapus.',
// Attributes
'name' => 'Nama Satuan',
'name' => 'Nama Satuan',
];

16
resources/lang/id/user.php

@ -2,12 +2,12 @@
return [
// Labels
'uset' => 'User',
'list' => 'Daftar User',
'search' => 'Cari User',
'not_found' => 'User tidak ditemukan',
'empty' => 'Belum ada User',
'back_to_index' => 'Kembali ke daftar User',
'uset' => 'User',
'list' => 'Daftar User',
'search' => 'Cari User',
'not_found' => 'User tidak ditemukan',
'empty' => 'Belum ada User',
'back_to_index' => 'Kembali ke daftar User',
// Actions
'create' => 'Input User Baru',
@ -23,6 +23,6 @@ return [
'undeleteable' => 'Data User tidak dapat dihapus.',
// Attributes
'name' => 'Nama User',
'username' => 'Username',
'name' => 'Nama User',
'username' => 'Username',
];

6
routes/web.php

@ -72,9 +72,9 @@ Route::group(['middleware' => 'auth'], function () {
/*
* Backup Restore Database Routes
*/
Route::post('backups/upload', ['as'=>'backups.upload', 'uses'=>'BackupsController@upload']);
Route::post('backups/{fileName}/restore', ['as'=>'backups.restore', 'uses'=>'BackupsController@restore']);
Route::get('backups/{fileName}/dl', ['as'=>'backups.download', 'uses'=>'BackupsController@download']);
Route::post('backups/upload', ['as' => 'backups.upload', 'uses' => 'BackupsController@upload']);
Route::post('backups/{fileName}/restore', ['as' => 'backups.restore', 'uses' => 'BackupsController@restore']);
Route::get('backups/{fileName}/dl', ['as' => 'backups.download', 'uses' => 'BackupsController@download']);
Route::resource('backups', 'BackupsController', ['except' => ['create', 'show', 'edit']]);
/*

4
tests/Feature/Cart/CartControllerTest.php

@ -21,8 +21,8 @@ class CartControllerTest extends TestCase
$cart = new CartCollection();
$response = $this->post(route('cart.add'), ['create-cash-draft'=> trans('transaction.create_cash')]);
$response = $this->post(route('cart.add'), ['create-credit-draft'=> trans('transaction.create_credit')]);
$response = $this->post(route('cart.add'), ['create-cash-draft' => trans('transaction.create_cash')]);
$response = $this->post(route('cart.add'), ['create-credit-draft' => trans('transaction.create_credit')]);
$response->assertSessionHas('transactions.drafts');
$cashDraft = $cart->content()->first();

6
tests/Feature/Cart/SearchProductsTest.php

@ -28,9 +28,9 @@ class SearchProductsTest extends TestCase
$user = $this->loginAsUser();
$response = $this->post(route('api.products.search'), [
'query' => 'Bis',
'draftType'=> $draft->type,
'draftKey' => $draft->draftKey,
'query' => 'Bis',
'draftType' => $draft->type,
'draftKey' => $draft->draftKey,
]);
$response->assertSuccessful();

Loading…
Cancel
Save