Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Kamansoft changes #11

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Homestead.yaml
.env
.phpunit.result.cache
.rnd
/vendor
composer.lock
/.expo
/.vscode
/docker-compose/db/data/
.gitkeep
/public/docs
/.scribe
!storage/fonts/.gitkeep
!storage/fonts/.gitkeep
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.1.6","version":"3.8.0:v3.8.0#cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"concat_space":true,"no_unused_imports":true,"not_operator_with_successor_space":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one","property":"one"}}},"hashes":{"\/tmp\/PHP CS Fixertemp_folder\/app\/Http\/Resources\/CustomerResource.php":3943590229,"\/tmp\/PHP CS Fixertemp_folder1\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder2\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder7\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder9\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder10\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder6\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder3\/app\/Http\/Resources\/CustomerResource.php":3943590229,"\/tmp\/PHP CS Fixertemp_folder300\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder4\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder8\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder5\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder343\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder702\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder206\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder11\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder334\/routes\/api.php":3669787445,"\/tmp\/PHP CS Fixertemp_folder656\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder202\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder558\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder640\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder328\/app\/Models\/Customer.php":1036751759,"\/tmp\/PHP CS Fixertemp_folder95\/app\/Traits\/HasCustomFieldsTrait.php":1654942436,"\/tmp\/PHP CS Fixertemp_folder258\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder429\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder641\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder74\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2756117564,"\/tmp\/PHP CS Fixertemp_folder307\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder115\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder579\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder797\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder256\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder530\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder707\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder77\/app\/Http\/Controllers\/V1\/Admin\/Customer\/CustomersController.php":2455267062,"\/tmp\/PHP CS Fixertemp_folder935\/app\/Models\/Customer.php":1036751759,"\/tmp\/PHP CS Fixertemp_folder816\/app\/Traits\/HasCustomFieldsTrait.php":1654942436,"\/tmp\/PHP CS Fixertemp_folder114\/app\/Models\/Customer.php":1036751759,"\/tmp\/PHP CS Fixertemp_folder731\/app\/Models\/Customer.php":1036751759,"\/tmp\/PHP CS Fixertemp_folder795\/app\/Models\/Customer.php":1036751759,"\/tmp\/PHP CS Fixertemp_folder724\/app\/Models\/Invoice.php":3660565311,"\/tmp\/PHP CS Fixertemp_folder427\/app\/Models\/PaymentMethod.php":3993773946,"\/tmp\/PHP CS Fixertemp_folder596\/app\/Models\/Customer.php":2634900782,"\/tmp\/PHP CS Fixertemp_folder270\/app\/Models\/Customer.php":2615426139,"\/tmp\/PHP CS Fixertemp_folder62\/app\/Models\/Customer.php":2615426139,"\/tmp\/PHP CS Fixertemp_folder441\/app\/Models\/Customer.php":3062985957,"\/tmp\/PHP CS Fixertemp_folder982\/app\/Models\/Customer.php":4073078396,"\/tmp\/PHP CS Fixertemp_folder595\/app\/Models\/Customer.php":2907069596,"\/tmp\/PHP CS Fixertemp_folder787\/app\/Models\/Customer.php":4242333751,"\/tmp\/PHP CS Fixertemp_folder646\/app\/Models\/Customer.php":3628412920,"\/tmp\/PHP CS Fixertemp_folder572\/app\/Models\/Customer.php":3556590784,"\/tmp\/PHP CS Fixertemp_folder394\/app\/Models\/Customer.php":3879405466,"\/tmp\/PHP CS Fixertemp_folder158\/app\/Models\/Customer.php":975233804}}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function index(Request $request)

$limit = $request->has('limit') ? $request->limit : 10;

$request_all=$request->all();
$customers = Customer::with('creator')
->whereCompany()
->applyFilters($request->all())
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Requests/CustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function rules()
'name' => [
'required',
],
'ftid' => [
'required',
],
'email' => [
'email',
'nullable',
Expand Down Expand Up @@ -132,6 +135,7 @@ public function getCustomerPayload()
return collect($this->validated())
->only([
'name',
'ftid',
'email',
'currency_id',
'password',
Expand Down
1 change: 1 addition & 0 deletions app/Http/Resources/CustomerResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function toArray($request)
return [
'id' => $this->id,
'name' => $this->name,
'ftid' => $this->ftid,
'email' => $this->email,
'phone' => $this->phone,
'contact_name' => $this->contact_name,
Expand Down
10 changes: 10 additions & 0 deletions app/Models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ public function scopeWhereContactName($query, $contactName)
return $query->where('contact_name', 'LIKE', '%'.$contactName.'%');
}

public function scopeWhereFtid($query, $ftid)
{
return $query->where('ftid', 'LIKE', '%'.$ftid.'%');
}

public function scopeWhereDisplayName($query, $displayName)
{
return $query->where('name', 'LIKE', '%'.$displayName.'%');
Expand Down Expand Up @@ -320,6 +325,11 @@ public function scopeApplyFilters($query, array $filters)
$query->whereContactName($filters->get('contact_name'));
}

if ($filters->get('ftid')) {
$query->whereFtid($filters->get('ftid'));
}


if ($filters->get('display_name')) {
$query->whereDisplayName($filters->get('display_name'));
}
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crater-invoice/crater",
"description": "Free & Open Source Invoice App for Individuals & Small Businesses. https://craterapp.com",
"name": "kamansoft/krater",
"description": "Free & Open Source Invoice App for Individuals & Small Businesses. a fork of https://craterapp.com",
"keywords": [
"framework",
"laravel"
Expand Down Expand Up @@ -81,7 +81,10 @@
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"extra": {
"laravel": {
Expand Down
Loading