Skip to content

Commit

Permalink
laravel ping style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zoranbogoevski committed Jul 5, 2024
1 parent 7957991 commit 53ccdc7
Show file tree
Hide file tree
Showing 384 changed files with 1,061 additions and 2,874 deletions.
27 changes: 12 additions & 15 deletions Modules/Admin/Database/Seeders/ConditionSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ class ConditionSeeder extends Seeder
public function run(): void
{
DB::table('conditions')->insert([
0 =>
[
'id' => 1,
'status' => 'New',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
1 =>
[
'id' => 2,
'status' => 'Used',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
0 => [
'id' => 1,
'status' => 'New',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
1 => [
'id' => 2,
'status' => 'Used',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
]);
}

}
78 changes: 36 additions & 42 deletions Modules/Admin/Database/Seeders/SizeSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,42 @@ class SizeSeeder extends Seeder
public function run(): void
{
DB::table('sizes')->insert([
0 =>
[
'id' => 1,
'name' => 'XS',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
1 =>
[
'id' => 2,
'name' => 'S',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
2 =>
[
'id' => 3,
'name' => 'M',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
3 =>
[
'id' => 4,
'name' => 'L',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
4 =>
[
'id' => 5,
'name' => 'XL',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
5 =>
[
'id' => 6,
'name' => 'XXL',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
0 => [
'id' => 1,
'name' => 'XS',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
1 => [
'id' => 2,
'name' => 'S',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
2 => [
'id' => 3,
'name' => 'M',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
3 => [
'id' => 4,
'name' => 'L',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
4 => [
'id' => 5,
'name' => 'XL',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
5 => [
'id' => 6,
'name' => 'XXL',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
]);
}
}
7 changes: 0 additions & 7 deletions Modules/Admin/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@

class AdminController extends CoreController
{

private AdminService $admin_service;

public function __construct(AdminService $admin_service)
{
$this->admin_service = $admin_service;
}

/**
* @return Application|Factory|View
*/
public function index(): View|Factory|Application
{
$data = $this->admin_service->index();
Expand All @@ -31,9 +27,6 @@ public function index(): View|Factory|Application
return view('admin::index', compact('paidOrdersByMonth', 'data'));
}

/**
* @return JsonResponse
*/
public function messageFive(): JsonResponse
{
$message = Message::whereNull('read_at')->limit(5)->get();
Expand Down
4 changes: 0 additions & 4 deletions Modules/Admin/Models/Condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ class Condition extends Core
'status',
];

/**
* @return BelongsToMany
*/
public function products(): BelongsToMany
{
return $this->belongsToMany(Product::class);
}

}
14 changes: 0 additions & 14 deletions Modules/Admin/Providers/AdminServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@

class AdminServiceProvider extends ServiceProvider
{
/**
* @var string $moduleName
*/
protected string $moduleName = 'Admin';

/**
* @var string $moduleNameLower
*/
protected string $moduleNameLower = 'admin';

/**
Expand All @@ -32,8 +26,6 @@ public function boot()

/**
* Register translations.
*
* @return void
*/
public function registerTranslations(): void
{
Expand All @@ -48,8 +40,6 @@ public function registerTranslations(): void

/**
* Register config.
*
* @return void
*/
protected function registerConfig(): void
{
Expand All @@ -64,8 +54,6 @@ protected function registerConfig(): void

/**
* Register views.
*
* @return void
*/
public function registerViews(): void
{
Expand Down Expand Up @@ -99,8 +87,6 @@ private function getPublishableViewPaths(): array

/**
* Register the service provider.
*
* @return void
*/
public function register(): void
{
Expand Down
2 changes: 0 additions & 2 deletions Modules/Admin/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected string $moduleNamespace = 'Modules\Admin\Http\Controllers';

Expand Down
5 changes: 1 addition & 4 deletions Modules/Admin/Repository/AdminRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
class AdminRepository
{
/**
*
* @return array<string, int> Array of paths.
*/
public function usersLastSevenDays(): array
Expand All @@ -23,13 +22,12 @@ public function usersLastSevenDays(): array
$count = User::whereDate('created_at', $date)->count();
$usersCount[$date] = $count;
}

return $usersCount;
}

/**
* Get the count of paid orders for each of the last 12 months.
*
* @return Collection
*/
public function getPaidOrdersCountByMonth(): Collection
{
Expand All @@ -45,5 +43,4 @@ public function getPaidOrdersCountByMonth(): Collection
->orderBy('month', 'desc')
->get();
}

}
4 changes: 1 addition & 3 deletions Modules/Admin/Service/AdminService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function __construct(AdminRepository $admin_repository)
}

/**
*
* @return array<string, int> Array of paths.
*/
public function index(): array
Expand All @@ -27,5 +26,4 @@ public function OrdersByMonth(): Collection
{
return $this->admin_repository->getPaidOrdersCountByMonth();
}

}
}
4 changes: 2 additions & 2 deletions Modules/Attribute/Database/Factories/AttributeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function definition(): array
'string',
'integer',
'boolean',
'decimal'
'decimal',
]),
'display' => $this->faker->randomElement([
'input',
Expand All @@ -34,7 +34,7 @@ public function definition(): array
'button',
'select',
'checkbox',
'multiselect'
'multiselect',
]),
'filterable' => $this->faker->numberBetween(0, 1),
'configurable' => $this->faker->numberBetween(0, 1),
Expand Down
26 changes: 13 additions & 13 deletions Modules/Attribute/Database/Factories/AttributeValueFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
class AttributeValueFactory extends Factory
{
protected $model = AttributeValue::class;

public function definition(): array
{
return [
'default' => $this->faker->word(),
'text_value' => $this->faker->text(),
'date_value' => Carbon::now(),
'time_value' => Carbon::now(),
'url_value' => $this->faker->url(),
'hex_value' => $this->faker->word(),
// 'float_value' => $this->faker->randomFloat(2),
'string_value' => $this->faker->word(),
'default' => $this->faker->word(),
'text_value' => $this->faker->text(),
'date_value' => Carbon::now(),
'time_value' => Carbon::now(),
'url_value' => $this->faker->url(),
'hex_value' => $this->faker->word(),
// 'float_value' => $this->faker->randomFloat(2),
'string_value' => $this->faker->word(),
'boolean_value' => $this->faker->boolean(),
'integer_value' => $this->faker->randomNumber(),
// 'decimal_value' => $this->faker->randomFloat(2),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
// 'decimal_value' => $this->faker->randomFloat(2),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),

'attribute_id' => Attribute::factory(),
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Expand All @@ -26,8 +25,6 @@ public function up(): void

/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('attribute_values', function (Blueprint $table) {
Expand All @@ -30,4 +31,4 @@ public function down(): void
{
Schema::dropIfExists('attribute_values');
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class AttributeDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(): void
{
Expand Down
4 changes: 1 addition & 3 deletions Modules/Attribute/Exceptions/SearchException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Exception;

class SearchException extends Exception
{
}
class SearchException extends Exception {}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function update(Update $request, int $id): JsonResponse
public function destroy(int $id): JsonResponse
{
$this->attribute_service->delete($id);

return $this
->setMessage(
__(
Expand Down
1 change: 0 additions & 1 deletion Modules/Attribute/Http/Controllers/AttributeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class AttributeController extends CoreController
{

protected AttributeService $attribute_service;

public function __construct(AttributeService $attribute_service)
Expand Down
Loading

0 comments on commit 53ccdc7

Please sign in to comment.