Skip to content

Commit

Permalink
Move Requests into Http\Requests
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed May 29, 2024
1 parent 6500b01 commit 32e2af4
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion resources/models/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
'type' => 'statuseditor',
'span' => 'right',
'form' => 'orderstatus',
'request' => \Igniter\Cart\Requests\OrderStatusRequest::class,
'request' => \Igniter\Cart\Http\Requests\OrderStatusRequest::class,
],
];

Expand Down
9 changes: 4 additions & 5 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Igniter\Cart\Models\Scopes\CategoryScope;
use Igniter\Cart\Models\Scopes\MenuScope;
use Igniter\Cart\Models\Scopes\OrderScope;
use Igniter\Cart\Requests\OrderSettingsRequest;
use Igniter\Flame\Igniter;
use Igniter\Local\Models\Location as LocationModel;
use Igniter\System\Classes\BaseExtension;
Expand Down Expand Up @@ -313,23 +312,23 @@ public function registerLocationSettings()
'icon' => 'fa fa-sliders',
'priority' => 0,
'form' => 'igniter.cart::/models/checkoutsettings',
'request' => \Igniter\Cart\Requests\CheckoutSettingsRequest::class,
'request' => \Igniter\Cart\Http\Requests\CheckoutSettingsRequest::class,
],
'delivery' => [
'label' => 'igniter.cart::default.settings.text_tab_delivery',
'description' => 'igniter.cart::default.settings.text_tab_desc_delivery',
'icon' => 'fa fa-sliders',
'priority' => 0,
'form' => 'igniter.cart::/models/deliverysettings',
'request' => \Igniter\Cart\Requests\DeliverySettingsRequest::class,
'request' => \Igniter\Cart\Http\Requests\DeliverySettingsRequest::class,
],
'collection' => [
'label' => 'igniter.cart::default.settings.text_tab_collection',
'description' => 'igniter.cart::default.settings.text_tab_desc_collection',
'icon' => 'fa fa-sliders',
'priority' => 0,
'form' => 'igniter.cart::/models/collectionsettings',
'request' => \Igniter\Cart\Requests\CollectionSettingsRequest::class,
'request' => \Igniter\Cart\Http\Requests\CollectionSettingsRequest::class,
],
];
}
Expand Down Expand Up @@ -438,7 +437,7 @@ protected function registerSystemSettings()
'permission' => ['Site.Settings'],
'url' => admin_url('settings/edit/order'),
'form' => 'igniter.cart::/models/ordersettings',
'request' => OrderSettingsRequest::class,
'request' => \Igniter\Cart\Http\Requests\OrderSettingsRequest::class,
],
]);
});
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Categories extends AdminController
public array $formConfig = [
'name' => 'lang:igniter.cart::default.categories.text_form_name',
'model' => \Igniter\Cart\Models\Category::class,
'request' => \Igniter\Cart\Requests\CategoryRequest::class,
'request' => \Igniter\Cart\Http\Requests\CategoryRequest::class,
'create' => [
'title' => 'lang:igniter::admin.form.create_title',
'redirect' => 'categories/edit/{category_id}',
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Ingredients.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Ingredients extends AdminController
public array $formConfig = [
'name' => 'lang:igniter.cart::default.ingredients.text_form_name',
'model' => \Igniter\Cart\Models\Ingredient::class,
'request' => \Igniter\Cart\Requests\IngredientRequest::class,
'request' => \Igniter\Cart\Http\Requests\IngredientRequest::class,
'create' => [
'title' => 'lang:igniter::admin.form.create_title',
'redirect' => 'ingredients/edit/{ingredient_id}',
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Mealtimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Mealtimes extends \Igniter\Admin\Classes\AdminController
public array $formConfig = [
'name' => 'lang:igniter.cart::default.mealtimes.text_form_name',
'model' => \Igniter\Cart\Models\Mealtime::class,
'request' => \Igniter\Cart\Requests\MealtimeRequest::class,
'request' => \Igniter\Cart\Http\Requests\MealtimeRequest::class,
'create' => [
'title' => 'lang:igniter::admin.form.create_title',
'redirect' => 'mealtimes/edit/{mealtime_id}',
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/MenuOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MenuOptions extends \Igniter\Admin\Classes\AdminController
public array $formConfig = [
'name' => 'lang:igniter.cart::default.menu_options.text_form_name',
'model' => \Igniter\Cart\Models\MenuOption::class,
'request' => \Igniter\Cart\Requests\MenuOptionRequest::class,
'request' => \Igniter\Cart\Http\Requests\MenuOptionRequest::class,
'create' => [
'title' => 'lang:igniter::admin.form.create_title',
'redirect' => 'menu_options/edit/{option_id}',
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Menus extends AdminController
public array $formConfig = [
'name' => 'lang:igniter.cart::default.menus.text_form_name',
'model' => \Igniter\Cart\Models\Menu::class,
'request' => \Igniter\Cart\Requests\MenuRequest::class,
'request' => \Igniter\Cart\Http\Requests\MenuRequest::class,
'create' => [
'title' => 'lang:igniter::admin.form.create_title',
'redirect' => 'menus/edit/{menu_id}',
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Orders extends \Igniter\Admin\Classes\AdminController
public array $formConfig = [
'name' => 'lang:igniter.cart::default.orders.text_form_name',
'model' => \Igniter\Cart\Models\Order::class,
'request' => \Igniter\Cart\Requests\OrderRequest::class,
'request' => \Igniter\Cart\Http\Requests\OrderRequest::class,
'edit' => [
'title' => 'lang:igniter::admin.form.edit_title',
'redirect' => 'orders/edit/{order_id}',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand All @@ -25,4 +25,4 @@ public function rules()
'payments.*' => ['string'],
];
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down Expand Up @@ -37,4 +37,4 @@ public function rules(): array
'min_order_amount' => ['numeric', 'min:0'],
];
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down Expand Up @@ -37,4 +37,4 @@ public function rules(): array
'delivery_min_order_amount' => ['numeric', 'min:0'],
];
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand All @@ -19,11 +19,11 @@ public function attributes()
'invoice_prefix' => lang('igniter.cart::default.label_invoice_prefix'),
'invoice_logo' => lang('igniter.cart::default.label_invoice_logo'),

'tax_mode' => lang('igniter::system.settings.label_tax_mode'),
'tax_title' => lang('igniter::system.settings.label_tax_title'),
'tax_percentage' => lang('igniter::system.settings.label_tax_percentage'),
'tax_menu_price' => lang('igniter::system.settings.label_tax_menu_price'),
'tax_delivery_charge' => lang('igniter::system.settings.label_tax_delivery_charge'),
'tax_mode' => lang('igniter.cart::default.label_tax_mode'),
'tax_title' => lang('igniter.cart::default.label_tax_title'),
'tax_percentage' => lang('igniter.cart::default.label_tax_percentage'),
'tax_menu_price' => lang('igniter.cart::default.label_tax_menu_price'),
'tax_delivery_charge' => lang('igniter.cart::default.label_tax_delivery_charge'),
];
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Igniter\Cart\Requests;
namespace Igniter\Cart\Http\Requests;

use Igniter\System\Classes\FormRequest;

Expand Down
2 changes: 1 addition & 1 deletion tests/Requests/CategoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tests\Requests;

use Igniter\Cart\Requests\CategoryRequest;
use Igniter\Cart\Http\Requests\CategoryRequest;

it('has rules for name input', function() {
$rules = array_get((new CategoryRequest)->rules(), 'name');
Expand Down
2 changes: 1 addition & 1 deletion tests/Requests/IngredientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tests\Requests;

use Igniter\Cart\Requests\IngredientRequest;
use Igniter\Cart\Http\Requests\IngredientRequest;

it('has rules for name input', function() {
$rules = array_get((new IngredientRequest)->rules(), 'name');
Expand Down
2 changes: 1 addition & 1 deletion tests/Requests/MealtimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tests\Requests;

use Igniter\Cart\Requests\MealtimeRequest;
use Igniter\Cart\Http\Requests\MealtimeRequest;

it('has required rule for inputs', function() {
expect('required')->toBeIn(array_get((new MealtimeRequest)->rules(), 'mealtime_name'))
Expand Down
2 changes: 1 addition & 1 deletion tests/Requests/MenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Tests\Requests;

use Igniter\Cart\Requests\MenuRequest;
use Igniter\Cart\Http\Requests\MenuRequest;

it('has required rule for inputs:
menu_name, menu_price, categories.*, ingredients.*, mealtimes.*, minimum_qty',
Expand Down

0 comments on commit 32e2af4

Please sign in to comment.