code
stringlengths
31
1.39M
docstring
stringlengths
23
16.8k
func_name
stringlengths
1
126
language
stringclasses
1 value
repo
stringlengths
7
63
path
stringlengths
7
166
url
stringlengths
50
220
license
stringclasses
7 values
public function create(User $user): bool { return $user->can('create_field'); }
Determine whether the user can create models.
create
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function update(User $user, Field $field): bool { return $user->can('update_field'); }
Determine whether the user can update the model.
update
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function delete(User $user, Field $field): bool { return $user->can('delete_field'); }
Determine whether the user can delete the model.
delete
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function deleteAny(User $user): bool { return $user->can('delete_any_field'); }
Determine whether the user can bulk delete.
deleteAny
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function forceDelete(User $user, Field $field): bool { return $user->can('force_delete_field'); }
Determine whether the user can permanently delete.
forceDelete
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function forceDeleteAny(User $user): bool { return $user->can('force_delete_any_field'); }
Determine whether the user can permanently bulk delete.
forceDeleteAny
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function restore(User $user, Field $field): bool { return $user->can('restore_field'); }
Determine whether the user can restore.
restore
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function restoreAny(User $user): bool { return $user->can('restore_any_field'); }
Determine whether the user can bulk restore.
restoreAny
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function replicate(User $user, Field $field): bool { return $user->can('replicate_field'); }
Determine whether the user can replicate.
replicate
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function reorder(User $user): bool { return $user->can('reorder_field'); }
Determine whether the user can reorder.
reorder
php
aureuserp/aureuserp
plugins/webkul/fields/src/Policies/FieldPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Policies/FieldPolicy.php
MIT
public function fill(array $attributes): static { $this->loadCustomFields(); return parent::fill($attributes); }
Fill the model with an array of attributes.
fill
php
aureuserp/aureuserp
plugins/webkul/fields/src/Traits/HasCustomFields.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Traits/HasCustomFields.php
MIT
protected function loadCustomFields() { try { $customFields = $this->getCustomFields(); $this->mergeFillable(self::$customFillable ??= $customFields->pluck('code')->toArray()); $this->mergeCasts(self::$customCasts ??= $customFields->select('code', 'type', 'is_multiselect')->get()); } catch (\Exception $e) { // do nothing } }
Load and merge custom fields into the model.
loadCustomFields
php
aureuserp/aureuserp
plugins/webkul/fields/src/Traits/HasCustomFields.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Traits/HasCustomFields.php
MIT
protected function getCustomFields() { return Field::where('customizable_type', get_class($this)); }
Get all custom field codes for this model
getCustomFields
php
aureuserp/aureuserp
plugins/webkul/fields/src/Traits/HasCustomFields.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Traits/HasCustomFields.php
MIT
public function mergeCasts($attributes) { if (is_array($attributes)) { parent::mergeCasts($attributes); return $attributes; } foreach ($attributes as $attribute) { match ($attribute->type) { 'select' => $this->casts[$attribute->code] = $attribute->is_multiselect ? 'array' : 'string', 'checkbox' => $this->casts[$attribute->code] = 'boolean', 'toggle' => $this->casts[$attribute->code] = 'boolean', 'checkbox_list' => $this->casts[$attribute->code] = 'array', default => $this->casts[$attribute->code] = 'string', }; } return $this; }
Add custom fields to fillable @param array $casts @return $this
mergeCasts
php
aureuserp/aureuserp
plugins/webkul/fields/src/Traits/HasCustomFields.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/fields/src/Traits/HasCustomFields.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/LocationFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/LocationFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/LotFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/LotFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/MoveFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/MoveFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/MoveLineFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/MoveLineFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/OperationFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/OperationFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/OperationTypeFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/OperationTypeFactory.php
MIT
public function definition(): array { return [ 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/OrderPointFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/OrderPointFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/PackageDestinationFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/PackageDestinationFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/PackageFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/PackageFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/PackageLevelFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/PackageLevelFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/PackageTypeFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/PackageTypeFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/ProductQuantityFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/ProductQuantityFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/ProductQuantityRelocationFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/ProductQuantityRelocationFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/RouteFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/RouteFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/RuleFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/RuleFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/ScrapFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/ScrapFactory.php
MIT
public function definition(): array { return [ 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/StorageCategoryCapacityFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/StorageCategoryCapacityFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/StorageCategoryFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/StorageCategoryFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'color' => fake()->hexColor(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/TagFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/TagFactory.php
MIT
public function definition(): array { return [ 'name' => fake()->name(), 'sort' => fake()->randomNumber(), 'creator_id' => User::factory(), ]; }
Define the model's default state. @return array<string, mixed>
definition
php
aureuserp/aureuserp
plugins/webkul/inventories/database/factories/WarehouseFactory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/factories/WarehouseFactory.php
MIT
public function run(): void { $user = User::first(); DB::table('inventories_operation_types')->delete(); DB::table('inventories_operation_types')->insert([ [ 'id' => 1, 'sort' => 1, 'name' => 'Receipts', 'type' => Enums\OperationType::INCOMING, 'sequence_code' => 'IN', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHIN', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => true, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 4, 'destination_location_id' => 12, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => null, 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 2, 'sort' => 2, 'name' => 'Delivery Orders', 'type' => Enums\OperationType::OUTGOING, 'sequence_code' => 'OUT', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHOUT', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => true, 'use_existing_lots' => true, 'print_label' => true, 'show_operations' => false, 'source_location_id' => 12, 'destination_location_id' => 5, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => null, 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 3, 'sort' => 3, 'name' => 'Pick', 'type' => Enums\OperationType::INTERNAL, 'sequence_code' => 'PICK', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHPICK', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => true, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 12, 'destination_location_id' => 16, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 4, 'sort' => 4, 'name' => 'Pack', 'type' => Enums\OperationType::INTERNAL, 'sequence_code' => 'PACK', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHPACK', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => false, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 16, 'destination_location_id' => 15, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 5, 'sort' => 5, 'name' => 'Quality Control', 'type' => Enums\OperationType::INTERNAL, 'sequence_code' => 'QC', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHQC', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => false, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 13, 'destination_location_id' => 14, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 6, 'sort' => 6, 'name' => 'Storage', 'type' => Enums\OperationType::INTERNAL, 'sequence_code' => 'STOR', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHSTOR', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => false, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 14, 'destination_location_id' => 12, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 7, 'sort' => 7, 'name' => 'Internal Transfers', 'type' => Enums\OperationType::INTERNAL, 'sequence_code' => 'INT', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHINT', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => false, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 12, 'destination_location_id' => 12, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 8, 'sort' => 8, 'name' => 'Cross Dock', 'type' => Enums\OperationType::INTERNAL, 'sequence_code' => 'XD', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'WHXD', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => false, 'use_existing_lots' => true, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 13, 'destination_location_id' => 15, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 9, 'sort' => 9, 'name' => 'Dropship', 'type' => Enums\OperationType::DROPSHIP, 'sequence_code' => 'DS', 'reservation_method' => Enums\ReservationMethod::AT_CONFIRM, 'product_label_format' => '2x7xprice', 'lot_label_format' => '4x12_lots', 'package_label_to_print' => 'pdf', 'barcode' => 'DS', 'create_backorder' => Enums\CreateBackorder::ASK, 'move_type' => Enums\MoveType::DIRECT, 'use_create_lots' => true, 'use_existing_lots' => false, 'print_label' => false, 'show_operations' => false, 'source_location_id' => 4, 'destination_location_id' => 5, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], ]); DB::table('inventories_operation_types')->where('id', 1)->update([ 'return_operation_type_id' => 2, ]); DB::table('inventories_operation_types')->where('id', 2)->update([ 'return_operation_type_id' => 1, ]); }
Seed the application's database with currencies.
run
php
aureuserp/aureuserp
plugins/webkul/inventories/database/seeders/OperationTypeSeeder.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/seeders/OperationTypeSeeder.php
MIT
public function run(): void { $user = User::first(); DB::table('inventories_routes')->delete(); DB::table('inventories_routes')->insert([ [ 'id' => 1, 'sort' => 1, 'name' => 'Replenish on Order (MTO)', 'product_selectable' => true, 'product_category_selectable' => false, 'warehouse_selectable' => false, 'packaging_selectable' => false, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 2, 'sort' => 2, 'name' => 'Your Company: Receive in 1 step (Stock)', 'product_selectable' => false, 'product_category_selectable' => true, 'warehouse_selectable' => true, 'packaging_selectable' => false, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => null, 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 3, 'sort' => 3, 'name' => 'Your Company: Deliver in 1 step (Ship)', 'product_selectable' => false, 'product_category_selectable' => true, 'warehouse_selectable' => true, 'packaging_selectable' => false, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => null, 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 4, 'sort' => 4, 'name' => 'Your Company: Cross-Dock', 'product_selectable' => true, 'product_category_selectable' => true, 'warehouse_selectable' => false, 'packaging_selectable' => false, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 5, 'sort' => 5, 'name' => 'Buy', 'product_selectable' => true, 'product_category_selectable' => false, 'warehouse_selectable' => false, 'packaging_selectable' => false, 'company_id' => null, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], [ 'id' => 6, 'sort' => 6, 'name' => 'Dropship', 'product_selectable' => true, 'product_category_selectable' => true, 'warehouse_selectable' => false, 'packaging_selectable' => false, 'company_id' => null, 'creator_id' => $user->id, 'deleted_at' => now(), 'created_at' => now(), 'updated_at' => now(), ], ]); }
Seed the application's database with currencies.
run
php
aureuserp/aureuserp
plugins/webkul/inventories/database/seeders/RouteSeeder.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/seeders/RouteSeeder.php
MIT
public function run(): void { $user = User::first(); DB::table('inventories_warehouses')->delete(); DB::table('inventories_warehouses')->insert([ [ 'id' => 1, 'name' => 'Your Company', 'code' => 'WH', 'sort' => 1, 'reception_steps' => ReceptionStep::ONE_STEP, 'delivery_steps' => DeliveryStep::ONE_STEP, 'company_id' => $user->default_company_id, 'creator_id' => $user->id, 'created_at' => now(), 'updated_at' => now(), 'view_location_id' => 11, 'lot_stock_location_id' => 12, 'input_stock_location_id' => 13, 'qc_stock_location_id' => 14, 'output_stock_location_id' => 15, 'pack_stock_location_id' => 16, 'mto_pull_id' => 5, 'buy_pull_id' => 13, 'pick_type_id' => 3, 'pack_type_id' => 4, 'out_type_id' => 2, 'in_type_id' => 1, 'internal_type_id' => 7, 'qc_type_id' => 5, 'store_type_id' => 6, 'xdock_type_id' => 8, 'crossdock_route_id' => 4, 'reception_route_id' => 2, 'delivery_route_id' => 3, ], ]); DB::table('inventories_locations')->whereIn('id', [11, 12, 13, 14, 15, 16])->update([ 'warehouse_id' => 1, ]); DB::table('inventories_route_warehouses')->insert([ [ 'warehouse_id' => 1, 'route_id' => 2, ], [ 'warehouse_id' => 1, 'route_id' => 3, ], ]); DB::table('inventories_operation_types')->where('id', '<>', 9)->update(['warehouse_id' => 1]); DB::table('inventories_rules')->where('id', '<>', 14)->update(['warehouse_id' => 1]); }
Seed the application's database with currencies.
run
php
aureuserp/aureuserp
plugins/webkul/inventories/database/seeders/WarehouseSeeder.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/database/seeders/WarehouseSeeder.php
MIT
public function createBackOrder(Operation $record): void { if (! $this->canCreateBackOrder($record)) { return; } $newOperation = $record->replicate()->fill([ 'state' => Enums\OperationState::DRAFT, 'origin' => $record->origin ?? $record->name, 'back_order_id' => $record->id, 'user_id' => Auth::id(), 'creator_id' => Auth::id(), ]); $newOperation->save(); foreach ($record->moves as $move) { if ($move->product_uom_qty <= $move->quantity) { continue; } $remainingQty = round($move->product_uom_qty - $move->quantity, 4); $newMove = $move->replicate()->fill([ 'operation_id' => $newOperation->id, 'reference' => $newOperation->name, 'state' => Enums\MoveState::DRAFT, 'product_qty' => $move->uom->computeQuantity($remainingQty, $move->product->uom, true, 'HALF-UP'), 'product_uom_qty' => $remainingQty, 'quantity' => $remainingQty, ]); $newMove->save(); } $newOperation->refresh(); $newOperation = $this->computeTransfer($newOperation); if (Package::isPluginInstalled('purchases')) { $newOperation->purchaseOrders()->attach($record->purchaseOrders->pluck('id')); foreach ($record->purchaseOrders as $purchaseOrder) { PurchaseOrderFacade::computePurchaseOrder($purchaseOrder); } } $url = OperationResource::getUrl('view', ['record' => $record]); $newOperation->addMessage([ 'body' => "This transfer has been created from <a href=\"{$url}\" target=\"_blank\" class=\"text-primary-600 dark:text-primary-400\">{$record->name}</a>.", 'type' => 'comment', ]); $url = OperationResource::getUrl('view', ['record' => $newOperation]); $record->addMessage([ 'body' => "The backorder <a href=\"{$url}\" target=\"_blank\" class=\"text-primary-600 dark:text-primary-400\">{$newOperation->name}</a> has been created.", 'type' => 'comment', ]); }
Process back order for the operation.
createBackOrder
php
aureuserp/aureuserp
plugins/webkul/inventories/src/InventoryManager.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/InventoryManager.php
MIT
public function canCreateBackOrder(Operation $record): bool { if ($record->operationType->create_backorder === Enums\CreateBackorder::NEVER) { return false; } return $record->moves->sum('product_uom_qty') > $record->moves->sum('quantity'); }
Check if a back order can be processed.
canCreateBackOrder
php
aureuserp/aureuserp
plugins/webkul/inventories/src/InventoryManager.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/InventoryManager.php
MIT
public function applyPushRules(Operation $record): void { $rules = []; foreach ($record->moves as $move) { if ($move->origin_returned_move_id) { continue; } $rule = $this->getPushRule($move); if (! $rule) { continue; } $ruleId = $rule->id; $pushedMove = $this->runPushRule($rule, $move); if (! isset($rules[$ruleId])) { $rules[$ruleId] = [ 'rule' => $rule, 'moves' => [$pushedMove], ]; } else { $rules[$ruleId]['moves'][] = $pushedMove; } } foreach ($rules as $ruleData) { $this->createPushOperation($record, $ruleData['rule'], $ruleData['moves']); } }
Apply push rules for the operation.
applyPushRules
php
aureuserp/aureuserp
plugins/webkul/inventories/src/InventoryManager.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/InventoryManager.php
MIT
private function createPushOperation(Operation $record, Rule $rule, array $moves): void { $newOperation = Operation::create([ 'state' => Enums\OperationState::DRAFT, 'origin' => $record->name, 'operation_type_id' => $rule->operation_type_id, 'source_location_id' => $rule->source_location_id, 'destination_location_id' => $rule->destination_location_id, 'scheduled_at' => now()->addDays($rule->delay), 'company_id' => $rule->company_id, 'user_id' => Auth::id(), 'creator_id' => Auth::id(), ]); foreach ($moves as $move) { $move->update([ 'operation_id' => $newOperation->id, 'reference' => $newOperation->name, ]); } $newOperation->refresh(); $this->computeTransfer($newOperation); }
Create a new operation based on a push rule and assign moves to it.
createPushOperation
php
aureuserp/aureuserp
plugins/webkul/inventories/src/InventoryManager.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/InventoryManager.php
MIT
public function getPushRule(Move $move, array $filters = []) { $foundRule = null; $location = $move->destinationLocation; $filters['action'] = [Enums\RuleAction::PUSH, Enums\RuleAction::PULL_PUSH]; while (! $foundRule && $location) { $filters['source_location_id'] = $location->id; $foundRule = $this->searchPushRule( $move->productPackaging, $move->product, $move->warehouse, $filters ); $location = $location->parent; } return $foundRule; }
Traverse up the location tree to find a matching push rule.
getPushRule
php
aureuserp/aureuserp
plugins/webkul/inventories/src/InventoryManager.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/InventoryManager.php
MIT
public function searchPushRule($productPackaging, $product, $warehouse, array $filters) { if ($warehouse) { $filters['warehouse_id'] = $warehouse->id; } $routeSources = [ [$productPackaging, 'routes'], [$product, 'routes'], [$product?->category, 'routes'], [$warehouse, 'routes'], ]; foreach ($routeSources as [$source, $relationName]) { if (! $source || ! $source->{$relationName}) { continue; } $routeIds = $source->{$relationName}->pluck('id'); if ($routeIds->isEmpty()) { continue; } $foundRule = Rule::whereIn('route_id', $routeIds) ->where($filters) ->orderBy('route_sort', 'asc') ->orderBy('sort', 'asc') ->first(); if ($foundRule) { return $foundRule; } } return null; }
Search for a push rule based on the provided filters.
searchPushRule
php
aureuserp/aureuserp
plugins/webkul/inventories/src/InventoryManager.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/InventoryManager.php
MIT
protected static function getFacadeAccessor(): string { return 'inventory'; }
Get the registered name of the component.
getFacadeAccessor
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Facades/Inventory.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Facades/Inventory.php
MIT
private function hasMoveLineErrors($move): bool { if ($move->lines->isEmpty()) { $this->sendNotification( 'inventories::filament/clusters/operations/actions/validate.notification.warning.lines-missing.title', 'inventories::filament/clusters/operations/actions/validate.notification.warning.lines-missing.body', 'warning' ); return true; } foreach ($move->lines as $line) { if ($line->package_id && $line->result_package_id && $line->package_id == $line->result_package_id) { $sourceQuantity = ProductQuantity::where('product_id', $line->product_id) ->where('location_id', $line->source_location_id) ->where('lot_id', $line->lot_id) ->where('package_id', $line->package_id) ->first(); if ($sourceQuantity && $sourceQuantity->quantity != $line->qty) { $this->sendNotification( 'inventories::filament/clusters/operations/actions/validate.notification.warning.partial-package.title', 'inventories::filament/clusters/operations/actions/validate.notification.warning.partial-package.body', 'warning' ); return true; } } } $isLotTracking = $move->product->tracking == Enums\ProductTracking::LOT || $move->product->tracking == Enums\ProductTracking::SERIAL; if ($isLotTracking && $move->lines->contains(fn ($line) => ! $line->lot_id)) { $this->sendNotification( 'inventories::filament/clusters/operations/actions/validate.notification.warning.lot-missing.title', 'inventories::filament/clusters/operations/actions/validate.notification.warning.lot-missing.body', 'warning' ); return true; } $isSerialTracking = $move->product->tracking == Enums\ProductTracking::SERIAL; if ($isSerialTracking) { if ($move->lines->contains(fn ($line) => $line->qty != 1)) { $this->sendNotification( 'inventories::filament/clusters/operations/actions/validate.notification.warning.serial-qty.title', 'inventories::filament/clusters/operations/actions/validate.notification.warning.serial-qty.body', 'warning' ); return true; } $lots = $move->lines->pluck('lot_id'); if ($lots->count() !== $lots->unique()->count()) { $this->sendNotification( 'inventories::filament/clusters/operations/actions/validate.notification.warning.serial-qty.title', 'inventories::filament/clusters/operations/actions/validate.notification.warning.serial-qty.body', 'warning' ); return true; } } return false; }
Check if the move lines are valid. @return bool Returns false if a validation warning is triggered.
hasMoveLineErrors
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Filament/Clusters/Operations/Actions/ValidateAction.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Filament/Clusters/Operations/Actions/ValidateAction.php
MIT
private function sendNotification(string $titleKey, string $bodyKey, string $type = 'info'): void { Notification::make() ->title(__($titleKey)) ->body(__($bodyKey)) ->{$type}() ->send(); }
Send a notification with the given title, body and type.
sendNotification
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Filament/Clusters/Operations/Actions/ValidateAction.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Filament/Clusters/Operations/Actions/ValidateAction.php
MIT
public function __construct(array $attributes = []) { parent::__construct($attributes); $this->mergeFillable([ ]); $this->mergeCasts([ ]); }
Create a new Eloquent model instance. @return void
__construct
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Category.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Category.php
MIT
public function updateFullName() { if ($this->type === LocationType::VIEW) { $this->full_name = $this->name; } else { $this->full_name = $this->parent ? $this->parent->full_name.'/'.$this->name : $this->name; } }
Update the full name without triggering additional events
updateFullName
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Location.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Location.php
MIT
public function updateParentPath() { if ($this->type === LocationType::VIEW) { $this->parent_path = $this->id.'/'; } else { $this->parent_path = $this->parent ? $this->parent->parent_path.$this->id.'/' : $this->id.'/'; } }
Update the full name without triggering additional events
updateParentPath
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Location.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Location.php
MIT
public function isPurchaseReturn() { return $this->destinationLocation->type === Enums\LocationType::SUPPLIER || ( $this->originReturnedMove && $this->destinationLocation->id === $this->destinationLocation->company->inter_company_location_id ); }
Determines if a stock move is a purchase return @return bool True if the move is a purchase return, false otherwise
isPurchaseReturn
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Move.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Move.php
MIT
public function isDropshipped() { return ( $this->sourceLocation->type === Enums\LocationType::SUPPLIER || ($this->sourceLocation->type === Enums\LocationType::TRANSIT && ! $this->sourceLocation->company_id) ) && ( $this->destinationLocation->type === Enums\LocationType::CUSTOMER || ($this->destinationLocation->type === Enums\LocationType::TRANSIT && ! $this->destinationLocation->company_id) ); }
Determines if a stock move is a purchase return @return bool True if the move is a purchase return, false otherwise
isDropshipped
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Move.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Move.php
MIT
public function isDropshippedReturned() { return ( $this->sourceLocation->type === Enums\LocationType::CUSTOMER || ($this->sourceLocation->type === Enums\LocationType::TRANSIT && ! $this->sourceLocation->company_id) ) && ( $this->destinationLocation->type === Enums\LocationType::SUPPLIER || ($this->destinationLocation->type === Enums\LocationType::TRANSIT && ! $this->destinationLocation->company_id) ); }
Determines if a stock move is a purchase return @return bool True if the move is a purchase return, false otherwise
isDropshippedReturned
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Move.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Move.php
MIT
public function updateName() { if (! $this->operationType->warehouse) { $this->name = $this->operationType->sequence_code.'/'.$this->id; } else { $this->name = $this->operationType->warehouse->code.'/'.$this->operationType->sequence_code.'/'.$this->id; } }
Update the full name without triggering additional events
updateName
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Operation.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Operation.php
MIT
public function __construct(array $attributes = []) { parent::__construct($attributes); $this->mergeFillable([ ]); $this->mergeCasts([ ]); }
Create a new Eloquent model instance. @return void
__construct
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Packaging.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Packaging.php
MIT
public function __construct(array $attributes = []) { $this->mergeFillable([ 'sale_delay', 'tracking', 'description_picking', 'description_pickingout', 'description_pickingin', 'is_storable', 'expiration_time', 'use_time', 'removal_time', 'alert_time', 'use_expiration_date', 'responsible_id', ]); $this->mergeCasts([ 'tracking' => Enums\ProductTracking::class, 'use_expiration_date' => 'boolean', 'is_storable' => 'boolean', ]); parent::__construct($attributes); }
Create a new Eloquent model instance. @return void
__construct
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Product.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Product.php
MIT
public function updateName() { $this->name = 'SP/'.$this->id; }
Update the full name without triggering additional events
updateName
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Models/Scrap.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Models/Scrap.php
MIT
public function viewAny(User $user): bool { return $user->can('view_any_product::attribute'); }
Determine whether the user can view any models.
viewAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function view(User $user, Attribute $attribute): bool { return $user->can('view_product::attribute'); }
Determine whether the user can view the model.
view
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function create(User $user): bool { return $user->can('create_product::attribute'); }
Determine whether the user can create models.
create
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function update(User $user, Attribute $attribute): bool { return $user->can('update_product::attribute'); }
Determine whether the user can update the model.
update
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function delete(User $user, Attribute $attribute): bool { return $user->can('delete_product::attribute'); }
Determine whether the user can delete the model.
delete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function deleteAny(User $user): bool { return $user->can('delete_any_product::attribute'); }
Determine whether the user can bulk delete.
deleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function forceDelete(User $user, Attribute $attribute): bool { return $user->can('force_delete_product::attribute'); }
Determine whether the user can permanently delete.
forceDelete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function forceDeleteAny(User $user): bool { return $user->can('force_delete_any_product::attribute'); }
Determine whether the user can permanently bulk delete.
forceDeleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function restore(User $user, Attribute $attribute): bool { return $user->can('restore_product::attribute'); }
Determine whether the user can restore.
restore
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function restoreAny(User $user): bool { return $user->can('restore_any_product::attribute'); }
Determine whether the user can bulk restore.
restoreAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function replicate(User $user, Attribute $attribute): bool { return $user->can('replicate_product::attribute'); }
Determine whether the user can replicate.
replicate
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function reorder(User $user): bool { return $user->can('reorder_product::attribute'); }
Determine whether the user can reorder.
reorder
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/AttributePolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/AttributePolicy.php
MIT
public function viewAny(User $user): bool { return $user->can('view_any_product::category'); }
Determine whether the user can view any models.
viewAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function view(User $user, Category $category): bool { return $user->can('view_product::category'); }
Determine whether the user can view the model.
view
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function create(User $user): bool { return $user->can('create_product::category'); }
Determine whether the user can create models.
create
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function update(User $user, Category $category): bool { return $user->can('update_product::category'); }
Determine whether the user can update the model.
update
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function delete(User $user, Category $category): bool { return $user->can('delete_product::category'); }
Determine whether the user can delete the model.
delete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function deleteAny(User $user): bool { return $user->can('delete_any_product::category'); }
Determine whether the user can bulk delete.
deleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function forceDelete(User $user, Category $category): bool { return $user->can('force_delete_product::category'); }
Determine whether the user can permanently delete.
forceDelete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function forceDeleteAny(User $user): bool { return $user->can('force_delete_any_product::category'); }
Determine whether the user can permanently bulk delete.
forceDeleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function restore(User $user, Category $category): bool { return $user->can('restore_product::category'); }
Determine whether the user can restore.
restore
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function restoreAny(User $user): bool { return $user->can('restore_any_product::category'); }
Determine whether the user can bulk restore.
restoreAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function replicate(User $user, Category $category): bool { return $user->can('replicate_product::category'); }
Determine whether the user can replicate.
replicate
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function reorder(User $user): bool { return $user->can('reorder_product::category'); }
Determine whether the user can reorder.
reorder
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/CategoryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/CategoryPolicy.php
MIT
public function viewAny(User $user): bool { return $user->can('view_any_delivery'); }
Determine whether the user can view any models.
viewAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function view(User $user, Delivery $delivery): bool { return $user->can('view_delivery'); }
Determine whether the user can view the model.
view
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function create(User $user): bool { return $user->can('create_delivery'); }
Determine whether the user can create models.
create
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function update(User $user, Delivery $delivery): bool { if (! $user->can('update_delivery')) { return false; } return $this->hasAccess($user, $delivery); }
Determine whether the user can update the model.
update
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function delete(User $user, Delivery $delivery): bool { if (! $user->can('delete_delivery')) { return false; } // dd($this->hasAccess($user, $delivery)); return $this->hasAccess($user, $delivery); }
Determine whether the user can delete the model.
delete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function deleteAny(User $user): bool { return $user->can('delete_any_delivery'); }
Determine whether the user can bulk delete.
deleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function forceDelete(User $user, Delivery $delivery): bool { if (! $user->can('force_delete_delivery')) { return false; } return $this->hasAccess($user, $delivery); }
Determine whether the user can permanently delete.
forceDelete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function forceDeleteAny(User $user): bool { return $user->can('force_delete_any_delivery'); }
Determine whether the user can permanently bulk delete.
forceDeleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function restore(User $user, Delivery $delivery): bool { if (! $user->can('restore_delivery')) { return false; } return $this->hasAccess($user, $delivery); }
Determine whether the user can restore.
restore
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function restoreAny(User $user): bool { return $user->can('restore_any_delivery'); }
Determine whether the user can bulk restore.
restoreAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function replicate(User $user, Delivery $delivery): bool { if (! $user->can('replicate_delivery')) { return false; } return $this->hasAccess($user, $delivery); }
Determine whether the user can replicate.
replicate
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function reorder(User $user): bool { return $user->can('reorder_delivery'); }
Determine whether the user can reorder.
reorder
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DeliveryPolicy.php
MIT
public function viewAny(User $user): bool { return $user->can('view_any_dropship'); }
Determine whether the user can view any models.
viewAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function view(User $user, Dropship $dropship): bool { return $user->can('view_dropship'); }
Determine whether the user can view the model.
view
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function create(User $user): bool { return $user->can('create_dropship'); }
Determine whether the user can create models.
create
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function update(User $user, Dropship $dropship): bool { if (! $user->can('update_dropship')) { return false; } return $this->hasAccess($user, $dropship); }
Determine whether the user can update the model.
update
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function delete(User $user, Dropship $dropship): bool { if (! $user->can('delete_dropship')) { return false; } return $this->hasAccess($user, $dropship); }
Determine whether the user can delete the model.
delete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function deleteAny(User $user): bool { return $user->can('delete_any_dropship'); }
Determine whether the user can bulk delete.
deleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function forceDelete(User $user, Dropship $dropship): bool { if (! $user->can('force_delete_dropship')) { return false; } return $this->hasAccess($user, $dropship); }
Determine whether the user can permanently delete.
forceDelete
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT
public function forceDeleteAny(User $user): bool { return $user->can('force_delete_any_dropship'); }
Determine whether the user can permanently bulk delete.
forceDeleteAny
php
aureuserp/aureuserp
plugins/webkul/inventories/src/Policies/DropshipPolicy.php
https://github.com/aureuserp/aureuserp/blob/master/plugins/webkul/inventories/src/Policies/DropshipPolicy.php
MIT