formatting
This commit is contained in:
parent
b83c566608
commit
3432ce26b8
@ -41,11 +41,9 @@ class Account extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -55,11 +53,9 @@ class Account extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -69,10 +65,8 @@ class Account extends Factory
|
||||
*/
|
||||
public function default_currency()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'currency_code' => setting('default.currency'),
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -70,11 +70,9 @@ class Bill extends Factory
|
||||
*/
|
||||
public function draft()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'draft',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,11 +82,9 @@ class Bill extends Factory
|
||||
*/
|
||||
public function received()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'received',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -98,11 +94,9 @@ class Bill extends Factory
|
||||
*/
|
||||
public function partial()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'partial',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,11 +106,9 @@ class Bill extends Factory
|
||||
*/
|
||||
public function paid()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'paid',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,11 +118,9 @@ class Bill extends Factory
|
||||
*/
|
||||
public function cancelled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
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 [
|
||||
return $this->state([
|
||||
'recurring_frequency' => 'yes',
|
||||
'recurring_interval' => '1',
|
||||
'recurring_custom_frequency' => $this->faker->randomElement($frequencies),
|
||||
'recurring_custom_frequency' => $this->faker->randomElement(['monthly', 'weekly']),
|
||||
'recurring_count' => '1',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,11 +39,9 @@ class Category extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,11 +51,9 @@ class Category extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,11 +63,9 @@ class Category extends Factory
|
||||
*/
|
||||
public function income()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'income',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,11 +75,9 @@ class Category extends Factory
|
||||
*/
|
||||
public function expense()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'expense',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,11 +87,9 @@ class Category extends Factory
|
||||
*/
|
||||
public function item()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'item',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,10 +99,8 @@ class Category extends Factory
|
||||
*/
|
||||
public function other()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'other',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -49,11 +49,9 @@ class Contact extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,11 +61,9 @@ class Contact extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,11 +73,9 @@ class Contact extends Factory
|
||||
*/
|
||||
public function customer()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'customer',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,10 +85,8 @@ class Contact extends Factory
|
||||
*/
|
||||
public function vendor()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'vendor',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -57,11 +57,9 @@ class Currency extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,10 +69,8 @@ class Currency extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -35,11 +35,9 @@ class Dashboard extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,11 +47,9 @@ class Dashboard extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,11 +59,9 @@ class Dashboard extends Factory
|
||||
*/
|
||||
public function users()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'users' => $this->getCompanyUsers(),
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,11 +71,9 @@ class Invoice extends Factory
|
||||
*/
|
||||
public function draft()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'draft',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -85,11 +83,9 @@ class Invoice extends Factory
|
||||
*/
|
||||
public function sent()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'sent',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,11 +95,9 @@ class Invoice extends Factory
|
||||
*/
|
||||
public function viewed()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'viewed',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,11 +107,9 @@ class Invoice extends Factory
|
||||
*/
|
||||
public function partial()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'partial',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -127,11 +119,9 @@ class Invoice extends Factory
|
||||
*/
|
||||
public function paid()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'status' => 'paid',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -141,11 +131,9 @@ class Invoice extends Factory
|
||||
*/
|
||||
public function cancelled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
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 [
|
||||
return $this->state([
|
||||
'recurring_frequency' => 'yes',
|
||||
'recurring_interval' => '1',
|
||||
'recurring_custom_frequency' => $this->faker->randomElement($frequencies),
|
||||
'recurring_custom_frequency' => $this->faker->randomElement(['monthly', 'weekly']),
|
||||
'recurring_count' => '1',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,11 +40,9 @@ class Item extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,10 +52,8 @@ class Item extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -38,16 +38,9 @@ class Role extends Factory
|
||||
*/
|
||||
public function permissions()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'permissions' => $this->getPermissions(),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
protected function getPermissions()
|
||||
{
|
||||
return Permission::take(50)->pluck('id')->toArray();
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,4 +54,9 @@ class Role extends Factory
|
||||
$role->permissions()->attach($this->getPermissions());
|
||||
});
|
||||
}
|
||||
|
||||
protected function getPermissions()
|
||||
{
|
||||
return Permission::take(50)->pluck('id')->toArray();
|
||||
}
|
||||
}
|
||||
|
@ -39,11 +39,9 @@ class Tax extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,11 +51,9 @@ class Tax extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,11 +63,9 @@ class Tax extends Factory
|
||||
*/
|
||||
public function normal()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'normal',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,11 +75,9 @@ class Tax extends Factory
|
||||
*/
|
||||
public function inclusive()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'inclusive',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,11 +87,9 @@ class Tax extends Factory
|
||||
*/
|
||||
public function compound()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'compound',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,11 +99,9 @@ class Tax extends Factory
|
||||
*/
|
||||
public function fixed()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'fixed',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -123,10 +111,8 @@ class Tax extends Factory
|
||||
*/
|
||||
public function withholding()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'type' => 'withholding',
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -49,12 +49,10 @@ class Transaction extends Factory
|
||||
*/
|
||||
public function income()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
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 [
|
||||
return $this->state([
|
||||
'type' => 'expense',
|
||||
'category_id' => $this->company->categories()->expense()->get()->random(1)->pluck('id')->first(),
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -44,11 +44,9 @@ class User extends Factory
|
||||
*/
|
||||
public function enabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 1,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -58,10 +56,8 @@ class User extends Factory
|
||||
*/
|
||||
public function disabled()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
return $this->state([
|
||||
'enabled' => 0,
|
||||
];
|
||||
});
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user