formatting

This commit is contained in:
Denis Duliçi 2020-10-15 00:08:41 +03:00
parent b83c566608
commit 3432ce26b8
12 changed files with 148 additions and 242 deletions

View File

@ -41,11 +41,9 @@ class Account extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -55,11 +53,9 @@ class Account extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
/**
@ -69,10 +65,8 @@ class Account extends Factory
*/
public function default_currency()
{
return $this->state(function (array $attributes) {
return [
'currency_code' => setting('default.currency'),
];
});
return $this->state([
'currency_code' => setting('default.currency'),
]);
}
}

View File

@ -70,11 +70,9 @@ class Bill extends Factory
*/
public function draft()
{
return $this->state(function (array $attributes) {
return [
'status' => 'draft',
];
});
return $this->state([
'status' => 'draft',
]);
}
/**
@ -84,11 +82,9 @@ class Bill extends Factory
*/
public function received()
{
return $this->state(function (array $attributes) {
return [
'status' => 'received',
];
});
return $this->state([
'status' => 'received',
]);
}
/**
@ -98,11 +94,9 @@ class Bill extends Factory
*/
public function partial()
{
return $this->state(function (array $attributes) {
return [
'status' => 'partial',
];
});
return $this->state([
'status' => 'partial',
]);
}
/**
@ -112,11 +106,9 @@ class Bill extends Factory
*/
public function paid()
{
return $this->state(function (array $attributes) {
return [
'status' => 'paid',
];
});
return $this->state([
'status' => 'paid',
]);
}
/**
@ -126,11 +118,9 @@ class Bill extends Factory
*/
public function cancelled()
{
return $this->state(function (array $attributes) {
return [
'status' => 'cancelled',
];
});
return $this->state([
'status' => 'cancelled',
]);
}
/**
@ -140,16 +130,12 @@ class Bill extends Factory
*/
public function recurring()
{
return $this->state(function (array $attributes) {
$frequencies = ['monthly', 'weekly'];
return [
'recurring_frequency' => 'yes',
'recurring_interval' => '1',
'recurring_custom_frequency' => $this->faker->randomElement($frequencies),
'recurring_count' => '1',
];
});
return $this->state([
'recurring_frequency' => 'yes',
'recurring_interval' => '1',
'recurring_custom_frequency' => $this->faker->randomElement(['monthly', 'weekly']),
'recurring_count' => '1',
]);
}
/**

View File

@ -39,11 +39,9 @@ class Category extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -53,11 +51,9 @@ class Category extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
/**
@ -67,11 +63,9 @@ class Category extends Factory
*/
public function income()
{
return $this->state(function (array $attributes) {
return [
'type' => 'income',
];
});
return $this->state([
'type' => 'income',
]);
}
/**
@ -81,11 +75,9 @@ class Category extends Factory
*/
public function expense()
{
return $this->state(function (array $attributes) {
return [
'type' => 'expense',
];
});
return $this->state([
'type' => 'expense',
]);
}
/**
@ -95,11 +87,9 @@ class Category extends Factory
*/
public function item()
{
return $this->state(function (array $attributes) {
return [
'type' => 'item',
];
});
return $this->state([
'type' => 'item',
]);
}
/**
@ -109,10 +99,8 @@ class Category extends Factory
*/
public function other()
{
return $this->state(function (array $attributes) {
return [
'type' => 'other',
];
});
return $this->state([
'type' => 'other',
]);
}
}

View File

@ -49,11 +49,9 @@ class Contact extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -63,11 +61,9 @@ class Contact extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
/**
@ -77,11 +73,9 @@ class Contact extends Factory
*/
public function customer()
{
return $this->state(function (array $attributes) {
return [
'type' => 'customer',
];
});
return $this->state([
'type' => 'customer',
]);
}
/**
@ -91,10 +85,8 @@ class Contact extends Factory
*/
public function vendor()
{
return $this->state(function (array $attributes) {
return [
'type' => 'vendor',
];
});
return $this->state([
'type' => 'vendor',
]);
}
}

View File

@ -57,11 +57,9 @@ class Currency extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -71,10 +69,8 @@ class Currency extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
}

View File

@ -35,11 +35,9 @@ class Dashboard extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -49,11 +47,9 @@ class Dashboard extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
/**
@ -63,11 +59,9 @@ class Dashboard extends Factory
*/
public function users()
{
return $this->state(function (array $attributes) {
return [
'users' => $this->getCompanyUsers(),
];
});
return $this->state([
'users' => $this->getCompanyUsers(),
]);
}
/**

View File

@ -71,11 +71,9 @@ class Invoice extends Factory
*/
public function draft()
{
return $this->state(function (array $attributes) {
return [
'status' => 'draft',
];
});
return $this->state([
'status' => 'draft',
]);
}
/**
@ -85,11 +83,9 @@ class Invoice extends Factory
*/
public function sent()
{
return $this->state(function (array $attributes) {
return [
'status' => 'sent',
];
});
return $this->state([
'status' => 'sent',
]);
}
/**
@ -99,11 +95,9 @@ class Invoice extends Factory
*/
public function viewed()
{
return $this->state(function (array $attributes) {
return [
'status' => 'viewed',
];
});
return $this->state([
'status' => 'viewed',
]);
}
/**
@ -113,11 +107,9 @@ class Invoice extends Factory
*/
public function partial()
{
return $this->state(function (array $attributes) {
return [
'status' => 'partial',
];
});
return $this->state([
'status' => 'partial',
]);
}
/**
@ -127,11 +119,9 @@ class Invoice extends Factory
*/
public function paid()
{
return $this->state(function (array $attributes) {
return [
'status' => 'paid',
];
});
return $this->state([
'status' => 'paid',
]);
}
/**
@ -141,11 +131,9 @@ class Invoice extends Factory
*/
public function cancelled()
{
return $this->state(function (array $attributes) {
return [
'status' => 'cancelled',
];
});
return $this->state([
'status' => 'cancelled',
]);
}
/**
@ -155,16 +143,12 @@ class Invoice extends Factory
*/
public function recurring()
{
return $this->state(function (array $attributes) {
$frequencies = ['monthly', 'weekly'];
return [
'recurring_frequency' => 'yes',
'recurring_interval' => '1',
'recurring_custom_frequency' => $this->faker->randomElement($frequencies),
'recurring_count' => '1',
];
});
return $this->state([
'recurring_frequency' => 'yes',
'recurring_interval' => '1',
'recurring_custom_frequency' => $this->faker->randomElement(['monthly', 'weekly']),
'recurring_count' => '1',
]);
}
/**

View File

@ -40,11 +40,9 @@ class Item extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -54,10 +52,8 @@ class Item extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
}

View File

@ -38,16 +38,9 @@ class Role extends Factory
*/
public function permissions()
{
return $this->state(function (array $attributes) {
return [
'permissions' => $this->getPermissions(),
];
});
}
protected function getPermissions()
{
return Permission::take(50)->pluck('id')->toArray();
return $this->state([
'permissions' => $this->getPermissions(),
]);
}
/**
@ -61,4 +54,9 @@ class Role extends Factory
$role->permissions()->attach($this->getPermissions());
});
}
protected function getPermissions()
{
return Permission::take(50)->pluck('id')->toArray();
}
}

View File

@ -39,11 +39,9 @@ class Tax extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -53,11 +51,9 @@ class Tax extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
/**
@ -67,11 +63,9 @@ class Tax extends Factory
*/
public function normal()
{
return $this->state(function (array $attributes) {
return [
'type' => 'normal',
];
});
return $this->state([
'type' => 'normal',
]);
}
/**
@ -81,11 +75,9 @@ class Tax extends Factory
*/
public function inclusive()
{
return $this->state(function (array $attributes) {
return [
'type' => 'inclusive',
];
});
return $this->state([
'type' => 'inclusive',
]);
}
/**
@ -95,11 +87,9 @@ class Tax extends Factory
*/
public function compound()
{
return $this->state(function (array $attributes) {
return [
'type' => 'compound',
];
});
return $this->state([
'type' => 'compound',
]);
}
/**
@ -109,11 +99,9 @@ class Tax extends Factory
*/
public function fixed()
{
return $this->state(function (array $attributes) {
return [
'type' => 'fixed',
];
});
return $this->state([
'type' => 'fixed',
]);
}
/**
@ -123,10 +111,8 @@ class Tax extends Factory
*/
public function withholding()
{
return $this->state(function (array $attributes) {
return [
'type' => 'withholding',
];
});
return $this->state([
'type' => 'withholding',
]);
}
}

View File

@ -49,12 +49,10 @@ class Transaction extends Factory
*/
public function income()
{
return $this->state(function (array $attributes) {
return [
'type' => 'income',
'category_id' => $this->company->categories()->income()->get()->random(1)->pluck('id')->first(),
];
});
return $this->state([
'type' => 'income',
'category_id' => $this->company->categories()->income()->get()->random(1)->pluck('id')->first(),
]);
}
/**
@ -64,11 +62,9 @@ class Transaction extends Factory
*/
public function expense()
{
return $this->state(function (array $attributes) {
return [
'type' => 'expense',
'category_id' => $this->company->categories()->expense()->get()->random(1)->pluck('id')->first(),
];
});
return $this->state([
'type' => 'expense',
'category_id' => $this->company->categories()->expense()->get()->random(1)->pluck('id')->first(),
]);
}
}

View File

@ -44,11 +44,9 @@ class User extends Factory
*/
public function enabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 1,
];
});
return $this->state([
'enabled' => 1,
]);
}
/**
@ -58,10 +56,8 @@ class User extends Factory
*/
public function disabled()
{
return $this->state(function (array $attributes) {
return [
'enabled' => 0,
];
});
return $this->state([
'enabled' => 0,
]);
}
}