mirror of
https://github.com/crater-invoice/crater.git
synced 2025-11-01 06:01:08 -04:00
build version 400
This commit is contained in:
@ -1,21 +1,39 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Address;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\Address;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Address::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'address_street_1' => $faker->streetAddress,
|
||||
'address_street_2' => $faker->streetAddress,
|
||||
'city' => $faker->city,
|
||||
'state' => $faker->state,
|
||||
'country_id' => 231,
|
||||
'zip' => $faker->postcode,
|
||||
'phone' => $faker->phoneNumber,
|
||||
'fax' => $faker->phoneNumber,
|
||||
'type' => Address::BILLING_TYPE
|
||||
];
|
||||
});
|
||||
class AddressFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Address::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'address_street_1' => $this->faker->streetAddress,
|
||||
'address_street_2' => $this->faker->streetAddress,
|
||||
'city' => $this->faker->city,
|
||||
'state' => $this->faker->state,
|
||||
'country_id' => 231,
|
||||
'zip' => $this->faker->postcode,
|
||||
'phone' => $this->faker->phoneNumber,
|
||||
'fax' => $this->faker->phoneNumber,
|
||||
'type' => $this->faker->randomElement([Address::BILLING_TYPE, Address::SHIPPING_TYPE]),
|
||||
'user_id' => User::factory()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,29 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Company;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\Company;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Company::class, function (Faker $faker) {
|
||||
return [
|
||||
'unique_hash' => str_random(60),
|
||||
'name' => $faker->name
|
||||
];
|
||||
});
|
||||
class CompanyFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Company::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'unique_hash' => str_random(60),
|
||||
'name' => $this->faker->name
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
31
database/factories/CompanySettingFactory.php
Normal file
31
database/factories/CompanySettingFactory.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\CompanySetting;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class CompanySettingFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = CompanySetting::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'option' => $this->faker->word,
|
||||
'value' => $this->faker->word,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
38
database/factories/CustomFieldFactory.php
Normal file
38
database/factories/CustomFieldFactory.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\CustomField;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class CustomFieldFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = CustomField::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'label' => $this->faker->name,
|
||||
'order' => $this->faker->randomDigitNotNull,
|
||||
'is_required' => $this->faker->randomElement([true, false]),
|
||||
'model_type'=> $this->faker->randomElement(['Customer', 'Invoice', 'Estimate', 'Expense', 'Payment']),
|
||||
'slug' => function (array $item) {
|
||||
return clean_slug($item['model_type'], $item['label']);
|
||||
},
|
||||
'type' => $this->faker->randomElement(['Text', 'Textarea', 'Phone', 'URL', 'Number','Dropdown' , 'Switch', 'Date', 'DateTime', 'Time']),
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
34
database/factories/CustomFieldValueFactory.php
Normal file
34
database/factories/CustomFieldValueFactory.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\CustomFieldValue;
|
||||
use Crater\Models\CustomField;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class CustomFieldValueFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = CustomFieldValue::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'custom_field_valuable_type' => $this->faker->name ,
|
||||
'custom_field_valuable_id' => 1,
|
||||
'type' => $this->faker->name,
|
||||
'custom_field_id' => CustomField::factory(),
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
38
database/factories/EmailLogFactory.php
Normal file
38
database/factories/EmailLogFactory.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\EmailLog;
|
||||
use Crater\Models\Estimate;
|
||||
use Crater\Models\Invoice;
|
||||
use Crater\Models\Payment;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class EmailLogFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = EmailLog::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'from' => $this->faker->unique()->safeEmail,
|
||||
'to' => $this->faker->unique()->safeEmail,
|
||||
'subject' => $this->faker->sentence,
|
||||
'body' => $this->faker->text,
|
||||
'mailable_type' => $this->faker->randomElement([Invoice::class, Estimate::class, Payment::class]),
|
||||
'mailable_id' => function (array $log) {
|
||||
return $log['mailable_type']::factory();
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -1,45 +1,96 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Estimate;
|
||||
use Crater\User;
|
||||
use Crater\Tax;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\EstimateItem;
|
||||
use Crater\EstimateTemplate;
|
||||
use Crater\Models\Estimate;
|
||||
use Crater\Models\EstimateTemplate;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Estimate::class, function (Faker $faker) {
|
||||
return [
|
||||
'estimate_date' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'expiry_date' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'estimate_number' => 'EST-'.Estimate::getNextEstimateNumber('EST'),
|
||||
'reference_number' => Estimate::getNextEstimateNumber('EST'),
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'user_id' => function () {
|
||||
return factory(User::class)->create(['role' => 'customer'])->id;
|
||||
},
|
||||
'status' => Estimate::STATUS_DRAFT,
|
||||
'estimate_template_id' => 1,
|
||||
'sub_total' => $faker->randomDigitNotNull,
|
||||
'discount' => 0,
|
||||
'discount_type' => 'fixed',
|
||||
'discount_val' => 0,
|
||||
'tax_per_item' => 'YES',
|
||||
'discount_per_item' => 'No',
|
||||
'total' => $faker->randomDigitNotNull,
|
||||
'tax' => $faker->randomDigitNotNull,
|
||||
'notes' => $faker->text(80),
|
||||
'unique_hash' => str_random(60)
|
||||
];
|
||||
});
|
||||
class EstimateFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Estimate::class;
|
||||
|
||||
$factory->afterCreating(Estimate::class, function ($estimate, $faker) {
|
||||
$estimate->items()->save(factory(EstimateItem::class)->make());
|
||||
$estimate->items()->save(factory(EstimateItem::class)->make());
|
||||
});
|
||||
public function sent()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Estimate::STATUS_SENT,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
$factory->afterCreating(Estimate::class, function ($estimate, $faker) {
|
||||
$estimate->taxes()->save(factory(Tax::class)->make());
|
||||
$estimate->items()->save(factory(Tax::class)->make());
|
||||
});
|
||||
public function viewed()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Estimate::STATUS_VIEWED,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function expired()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Estimate::STATUS_EXPIRED,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function accepted()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Estimate::STATUS_ACCEPTED,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function rejected()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Estimate::STATUS_REJECTED,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'estimate_date' => $this->faker->date('Y-m-d', 'now'),
|
||||
'expiry_date' => $this->faker->date('Y-m-d', 'now'),
|
||||
'estimate_number' => 'EST-'.Estimate::getNextEstimateNumber('EST'),
|
||||
'reference_number' => Estimate::getNextEstimateNumber('EST'),
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'user_id' => User::factory()->create(['role' => 'customer'])->id,
|
||||
'status' => Estimate::STATUS_DRAFT,
|
||||
'estimate_template_id' => EstimateTemplate::find(1) ?? EstimateTemplate::factory(),
|
||||
'sub_total' => $this->faker->randomDigitNotNull,
|
||||
'total' => $this->faker->randomDigitNotNull,
|
||||
'discount_type' => $this->faker->randomElement(['percentage', 'fixed']),
|
||||
'discount_val' => function (array $estimate) {
|
||||
return $estimate['discount_type'] == 'percentage' ? $this->faker->numberBetween($min = 0, $max = 100) : $this->faker->randomDigitNotNull;
|
||||
},
|
||||
'discount' => function (array $estimate) {
|
||||
return $estimate['discount_type'] == 'percentage' ? (($estimate['discount_val'] * $estimate['total']) / 100) : $estimate['discount_val'];
|
||||
},
|
||||
'tax_per_item' => 'YES',
|
||||
'discount_per_item' => 'No',
|
||||
'tax' => $this->faker->randomDigitNotNull,
|
||||
'notes' => $this->faker->text(80),
|
||||
'unique_hash' => str_random(60),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,34 +1,52 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\EstimateItem;
|
||||
use Crater\Item;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\EstimateItem;
|
||||
use Crater\Models\Item;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(EstimateItem::class, function (Faker $faker) {
|
||||
return [
|
||||
'item_id' => function () {
|
||||
return factory(Item::class)->create()->id;
|
||||
},
|
||||
'name' => function (array $item) {
|
||||
return Item::find($item['item_id'])->name;
|
||||
},
|
||||
'description' => function (array $item) {
|
||||
return Item::find($item['item_id'])->description;
|
||||
},
|
||||
'price' => function (array $item) {
|
||||
return Item::find($item['item_id'])->price;
|
||||
},
|
||||
'quantity' => $faker->randomDigitNotNull,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'discount_type' => 'fixed',
|
||||
'tax' => $faker->randomDigitNotNull,
|
||||
'discount_val' => 0,
|
||||
'total' => function (array $item) {
|
||||
return ($item['price'] * $item['quantity']);
|
||||
},
|
||||
'discount' => 0
|
||||
];
|
||||
});
|
||||
class EstimateItemFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = EstimateItem::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'item_id' => Item::factory(),
|
||||
'name' => function (array $item) {
|
||||
return Item::find($item['item_id'])->name;
|
||||
},
|
||||
'description' => function (array $item) {
|
||||
return Item::find($item['item_id'])->description;
|
||||
},
|
||||
'price' => function (array $item) {
|
||||
return Item::find($item['item_id'])->price;
|
||||
},
|
||||
'quantity' => $this->faker->randomDigitNotNull,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'tax' => $this->faker->randomDigitNotNull,
|
||||
'total' => function (array $item) {
|
||||
return ($item['price'] * $item['quantity']);
|
||||
},
|
||||
'discount_type' => $this->faker->randomElement(['percentage', 'fixed']),
|
||||
'discount_val' => function (array $estimate) {
|
||||
return $estimate['discount_type'] == 'percentage' ? $this->faker->numberBetween($min = 0, $max = 100) : $this->faker->randomDigitNotNull;
|
||||
},
|
||||
'discount' => function (array $estimate) {
|
||||
return $estimate['discount_type'] == 'percentage' ? (($estimate['discount_val'] * $estimate['total']) / 100) : $estimate['discount_val'];
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,30 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\EstimateTemplate;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\EstimateTemplate;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(EstimateTemplate::class, function (Faker $faker) {
|
||||
return [
|
||||
'path' => $faker->word,
|
||||
'view' => $faker->word,
|
||||
'name' => $faker->word,
|
||||
];
|
||||
});
|
||||
class EstimateTemplateFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = EstimateTemplate::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'path' => $this->faker->word,
|
||||
'view' => $this->faker->word,
|
||||
'name' => $this->faker->word,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,31 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\ExpenseCategory;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\ExpenseCategory;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(ExpenseCategory::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->word,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'description' => $faker->text
|
||||
];
|
||||
});
|
||||
class ExpenseCategoryFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = ExpenseCategory::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->word,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'description' => $this->faker->text
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,21 +1,35 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Expense;
|
||||
use Crater\ExpenseCategory;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\Expense;
|
||||
use Crater\Models\User;
|
||||
use Crater\Models\ExpenseCategory;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Expense::class, function (Faker $faker) {
|
||||
return [
|
||||
'expense_date' => $faker->date($format = 'd/m/Y', $max = 'now'),
|
||||
'expense_category_id' => function () {
|
||||
return factory(ExpenseCategory::class)->create()->id;
|
||||
},
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'amount' => $faker->randomDigitNotNull,
|
||||
'notes' => $faker->text,
|
||||
'attachment_receipt' => null
|
||||
];
|
||||
});
|
||||
class ExpenseFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Expense::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'expense_date' => $this->faker->date('Y-m-d', 'now'),
|
||||
'expense_category_id' => ExpenseCategory::factory(),
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'amount' => $this->faker->randomDigitNotNull,
|
||||
'notes' => $this->faker->text,
|
||||
'attachment_receipt' => null
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
35
database/factories/FileDiskFactory.php
Normal file
35
database/factories/FileDiskFactory.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\FileDisk;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class FileDiskFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = FileDisk::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->word,
|
||||
'driver' => 'local',
|
||||
'set_as_default' => false,
|
||||
'credentials' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
]
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -1,49 +1,127 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Invoice;
|
||||
use Crater\User;
|
||||
use Crater\Tax;
|
||||
use Crater\InvoiceItem;
|
||||
use Crater\InvoiceTemplate;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\Invoice;
|
||||
use Crater\Models\User;
|
||||
use Crater\Models\InvoiceTemplate;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Invoice::class, function (Faker $faker) {
|
||||
return [
|
||||
'invoice_date' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'due_date' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'invoice_number' => 'INV-'.Invoice::getNextInvoiceNumber('INV'),
|
||||
'reference_number' => Invoice::getNextInvoiceNumber('INV'),
|
||||
'user_id' => function () {
|
||||
return factory(User::class)->create(['role' => 'customer'])->id;
|
||||
},
|
||||
'invoice_template_id' => 1,
|
||||
'status' => Invoice::STATUS_DRAFT,
|
||||
'tax_per_item' => 'NO',
|
||||
'discount_per_item' => 'NO',
|
||||
'paid_status' => Invoice::STATUS_UNPAID,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'sub_total' => $faker->randomDigitNotNull,
|
||||
'discount' => 0,
|
||||
'discount_type' => 'fixed',
|
||||
'discount_val' => 0,
|
||||
'total' => $faker->randomDigitNotNull,
|
||||
'tax' => $faker->randomDigitNotNull,
|
||||
'due_amount' => function (array $invoice) {
|
||||
return $invoice['total'];
|
||||
},
|
||||
'notes' => $faker->text(80),
|
||||
'unique_hash' => str_random(60)
|
||||
];
|
||||
});
|
||||
class InvoiceFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Invoice::class;
|
||||
|
||||
$factory->afterCreating(Invoice::class, function ($invoice, $faker) {
|
||||
$invoice->items()->save(factory(InvoiceItem::class)->make());
|
||||
$invoice->items()->save(factory(InvoiceItem::class)->make());
|
||||
});
|
||||
public function sent()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_SENT,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
$factory->afterCreating(Invoice::class, function ($invoice, $faker) {
|
||||
$invoice->taxes()->save(factory(Tax::class)->make());
|
||||
$invoice->items()->save(factory(Tax::class)->make());
|
||||
});
|
||||
public function viewed()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_VIEWED,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function overdue()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_OVERDUE,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function completed()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_COMPLETED,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function due()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_DUE,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function unpaid()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_UNPAID,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function partiallyPaid()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_PARTIALLY_PAID,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function paid()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'status' => Invoice::STATUS_PAID,
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'invoice_date' => $this->faker->date('Y-m-d', 'now'),
|
||||
'due_date' => $this->faker->date('Y-m-d', 'now'),
|
||||
'invoice_number' => 'INV-'.Invoice::getNextInvoiceNumber('INV'),
|
||||
'reference_number' => Invoice::getNextInvoiceNumber('INV'),
|
||||
'user_id' => User::factory()->create(['role' => 'customer'])->id,
|
||||
'invoice_template_id' => InvoiceTemplate::find(1) ?? InvoiceTemplate::factory(),
|
||||
'status' => Invoice::STATUS_DRAFT,
|
||||
'tax_per_item' => 'NO',
|
||||
'discount_per_item' => 'NO',
|
||||
'paid_status' => Invoice::STATUS_UNPAID,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'sub_total' => $this->faker->randomDigitNotNull,
|
||||
'total' => $this->faker->randomDigitNotNull,
|
||||
'discount_type' => $this->faker->randomElement(['percentage', 'fixed']),
|
||||
'discount_val' => function (array $invoice) {
|
||||
return $invoice['discount_type'] == 'percentage' ? $this->faker->numberBetween($min = 0, $max = 100) : $this->faker->randomDigitNotNull;
|
||||
},
|
||||
'discount' => function (array $invoice) {
|
||||
return $invoice['discount_type'] == 'percentage' ? (($invoice['discount_val'] * $invoice['total']) / 100) : $invoice['discount_val'];
|
||||
},
|
||||
'tax' => $this->faker->randomDigitNotNull,
|
||||
'due_amount' => function (array $invoice) {
|
||||
return $invoice['total'];
|
||||
},
|
||||
'notes' => $this->faker->text(80),
|
||||
'unique_hash' => str_random(60)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,34 +1,52 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\InvoiceItem;
|
||||
use Crater\Item;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\InvoiceItem;
|
||||
use Crater\Models\Item;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(InvoiceItem::class, function (Faker $faker) {
|
||||
return [
|
||||
'item_id' => function () {
|
||||
return factory(Item::class)->create()->id;
|
||||
},
|
||||
'name' => function (array $item) {
|
||||
return Item::find($item['item_id'])->name;
|
||||
},
|
||||
'description' => function (array $item) {
|
||||
return Item::find($item['item_id'])->description;
|
||||
},
|
||||
'price' => function (array $item) {
|
||||
return Item::find($item['item_id'])->price;
|
||||
},
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'quantity' => $faker->randomDigitNotNull,
|
||||
'discount_type' => 'fixed',
|
||||
'discount_val' => 0,
|
||||
'tax' => $faker->randomDigitNotNull,
|
||||
'total' => function (array $item) {
|
||||
return ($item['price'] * $item['quantity']);
|
||||
},
|
||||
'discount' => 0
|
||||
];
|
||||
});
|
||||
class InvoiceItemFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = InvoiceItem::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'item_id' => Item::factory(),
|
||||
'name' => function (array $item) {
|
||||
return Item::find($item['item_id'])->name;
|
||||
},
|
||||
'description' => function (array $item) {
|
||||
return Item::find($item['item_id'])->description;
|
||||
},
|
||||
'price' => function (array $item) {
|
||||
return Item::find($item['item_id'])->price;
|
||||
},
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'quantity' => $this->faker->randomDigitNotNull,
|
||||
'total' => function (array $item) {
|
||||
return ($item['price'] * $item['quantity']);
|
||||
},
|
||||
'discount_type' => $this->faker->randomElement(['percentage', 'fixed']),
|
||||
'discount_val' => function (array $invoice) {
|
||||
return $invoice['discount_type'] == 'percentage' ? $this->faker->numberBetween($min = 0, $max = 100) : $this->faker->randomDigitNotNull;
|
||||
},
|
||||
'discount' => function (array $invoice) {
|
||||
return $invoice['discount_type'] == 'percentage' ? (($invoice['discount_val'] * $invoice['total']) / 100) : $invoice['discount_val'];
|
||||
},
|
||||
'tax' => $this->faker->randomDigitNotNull,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,30 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\InvoiceTemplate;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\InvoiceTemplate;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(InvoiceTemplate::class, function (Faker $faker) {
|
||||
return [
|
||||
'path' => $faker->word,
|
||||
'view' => $faker->word,
|
||||
'name' => $faker->word,
|
||||
];
|
||||
});
|
||||
class InvoiceTemplateFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = InvoiceTemplate::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'path' => $this->faker->word,
|
||||
'view' => $this->faker->word,
|
||||
'name' => $this->faker->word,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,34 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Item;
|
||||
use Crater\Tax;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\Item;
|
||||
use Crater\Models\User;
|
||||
use Crater\Models\Unit;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Item::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'description' => $faker->text,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'price' => $faker->randomDigitNotNull,
|
||||
'unit' => 'kg'
|
||||
];
|
||||
});
|
||||
class ItemFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Item::class;
|
||||
|
||||
$factory->afterCreating(Item::class, function ($item, $faker) {
|
||||
$item->taxes()->save(factory(Tax::class)->make());
|
||||
$item->taxes()->save(factory(Tax::class)->make());
|
||||
});
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'description' => $this->faker->text,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'price' => $this->faker->randomDigitNotNull,
|
||||
'unit_id' => Unit::factory()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Crater\Address;
|
||||
use Crater\User;
|
||||
use Crater\Currency;
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of your model factories. Model factories give
|
||||
| you a convenient way to create models for testing and seeding your
|
||||
| database. Just tell the factory how a default model should look.
|
||||
|
|
||||
*/
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
$factory->define(User::class, function (Faker\Generator $faker) {
|
||||
static $password;
|
||||
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'company_name' => $faker->company,
|
||||
'contact_name' => $faker->name,
|
||||
'website' => $faker->url,
|
||||
'enable_portal' => true,
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'phone' => $faker->phoneNumber,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'role' => 'admin',
|
||||
'password' => $password ?: $password = Hash::make('secret'),
|
||||
'remember_token' => str_random(10),
|
||||
'currency_id' => Currency::first()->id
|
||||
];
|
||||
});
|
||||
|
||||
$factory->afterCreating(User::class, function ($user, $faker) {
|
||||
$user->addresses()->save(factory(Address::class)->make());
|
||||
$user->addresses()->save(factory(Address::class)->make(['type' => Address::SHIPPING_TYPE]));
|
||||
});
|
||||
30
database/factories/NoteFactory.php
Normal file
30
database/factories/NoteFactory.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\Note;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class NoteFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Note::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'type' => $this->faker->randomElement(['Invoice', 'Estimate', 'Payment']),
|
||||
'name' => $this->faker->word,
|
||||
'notes' => $this->faker->text
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -1,22 +1,34 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Payment;
|
||||
use Crater\PaymentMethod;
|
||||
use Crater\User;
|
||||
use Crater\Invoice;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\Payment;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Payment::class, function (Faker $faker) {
|
||||
return [
|
||||
'user_id' => function () {
|
||||
return factory(User::class)->create(['role' => 'customer'])->id;
|
||||
},
|
||||
'payment_date' => $faker->date($format = 'Y-m-d', $max = 'now'),
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'notes' => $faker->text(80),
|
||||
'amount' => $faker->randomDigitNotNull,
|
||||
'payment_number' => 'PAY-'.Payment::getNextPaymentNumber('PAY'),
|
||||
];
|
||||
});
|
||||
class PaymentFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Payment::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory()->create(['role' => 'customer'])->id,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'payment_date' => $this->faker->date('Y-m-d', 'now'),
|
||||
'notes' => $this->faker->text(80),
|
||||
'amount' => $this->faker->randomDigitNotNull,
|
||||
'payment_number' => 'PAY-' . Payment::getNextPaymentNumber('PAY'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,30 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\PaymentMethod;
|
||||
use Crater\User;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\Models\PaymentMethod;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(PaymentMethod::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
];
|
||||
});
|
||||
class PaymentMethodFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = PaymentMethod::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,24 +1,38 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Tax;
|
||||
use Crater\TaxType;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\Tax;
|
||||
use Crater\Models\TaxType;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(Tax::class, function (Faker $faker) {
|
||||
return [
|
||||
'tax_type_id' => function () {
|
||||
return factory(TaxType::class)->create()->id;
|
||||
},
|
||||
'percent' => function (array $item) {
|
||||
return TaxType::find($item['tax_type_id'])->percent;
|
||||
},
|
||||
'name' => function (array $item) {
|
||||
return TaxType::find($item['tax_type_id'])->name;
|
||||
},
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'amount' => $faker->randomDigitNotNull
|
||||
];
|
||||
});
|
||||
class TaxFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Tax::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'tax_type_id' => TaxType::factory(),
|
||||
'percent' => function (array $item) {
|
||||
return TaxType::find($item['tax_type_id'])->percent;
|
||||
},
|
||||
'name' => function (array $item) {
|
||||
return TaxType::find($item['tax_type_id'])->name;
|
||||
},
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
'amount' => $this->faker->randomDigitNotNull
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,34 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\TaxType;
|
||||
use Faker\Generator as Faker;
|
||||
use Crater\User;
|
||||
use Crater\Models\TaxType;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
$factory->define(TaxType::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->word,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'percent' => $faker->randomDigitNotNull,
|
||||
'description' => $faker->text,
|
||||
'compound_tax' => 0,
|
||||
'collective_tax' => 0
|
||||
];
|
||||
});
|
||||
class TaxTypeFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = TaxType::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->word,
|
||||
'company_id' => User::where('role','super admin')->first()->company_id,
|
||||
'percent' => $this->faker->numberBetween($min = 0, $max = 100),
|
||||
'description' => $this->faker->text,
|
||||
'compound_tax' => 0,
|
||||
'collective_tax' => 0
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
30
database/factories/UnitFactory.php
Normal file
30
database/factories/UnitFactory.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\Unit;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class UnitFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = Unit::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'company_id' => User::where('role', 'super admin')->first()->company_id,
|
||||
];
|
||||
}
|
||||
}
|
||||
40
database/factories/UserFactory.php
Normal file
40
database/factories/UserFactory.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Crater\Models\Currency;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = User::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name,
|
||||
'company_name' => $this->faker->company,
|
||||
'contact_name' => $this->faker->name,
|
||||
'website' => $this->faker->url,
|
||||
'enable_portal' => true,
|
||||
'email' => $this->faker->unique()->safeEmail,
|
||||
'phone' => $this->faker->phoneNumber,
|
||||
'company_id' => User::find(1)->company_id,
|
||||
'role' => 'super admin',
|
||||
'password' => Hash::make('secret'),
|
||||
'currency_id' => Currency::first()->id
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user