Skip to content

Commit 5931487

Browse files
committed
Merge branch 'master' into upgrade-package-service-provider-from-spatie
2 parents 26cb69f + ba7749d commit 5931487

26 files changed

+317
-48
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
steps:
1010
- name: Checkout code
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v3
1212
with:
1313
ref: ${{ github.head_ref }}
1414

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: phpstan
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Checkout code
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
2828

2929
- name: Setup PHP
3030
uses: shivammathur/setup-php@v2

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
with:
1515
ref: main
1616

.php-cs-fixer.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"8.1.3","version":"3.7.0","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"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":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"}}},"hashes":{"src\/Models\/Note.php":576988369,"src\/Models\/Service.php":589425630,"src\/Models\/Lead.php":1420902803,"src\/SimpleCrmServiceProvider.php":3677119947,"tests\/Unit\/LeadTest.php":820572205,"tests\/Unit\/ServiceTest.php":303507015,"tests\/Unit\/NoteTest.php":3367683590,"tests\/Models\/User.php":546769323,"tests\/TestCase.php":610046076,"tests\/Pest.php":2378833050,"src\/Models\/Enums\/ProjectStatus.php":240630045,"src\/Models\/Enums\/NoteStatus.php":780172828,"src\/Models\/Enums\/LeadStatus.php":2060495691,"src\/Models\/Project.php":705501016}}

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ You can install the package via composer:
1717
composer require tepuilabs/simple-crm
1818
```
1919

20-
You can publish the modesl with:
21-
22-
```bash
23-
php artisan vendor:publish --provider="Tepuilabs\SimpleCrm\SimpleCrmServiceProvider" --tag="simple-crm-models"
24-
```
25-
2620
You can publish and run the migrations with:
2721

2822
```bash
@@ -37,8 +31,9 @@ This package uses a polymorphic relationship to associate the Items model with t
3731
```php
3832
public function notes(): MorphMany
3933
{
40-
return $this->morphMany(\App\Models\Tepuilabs\SimpleCrm\Note::class, 'author');
34+
return $this->morphMany(\Tepuilabs\SimpleCrm\Models\Note::class, 'author');
4135
}
36+
4237
```
4338

4439
## Testing

database/factories/LeadFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Tepuilabs\SimpleCrm\Models\Enums\Lead\LeadType;
88
use Tepuilabs\SimpleCrm\Models\Lead;
99

10-
1110
class LeadFactory extends Factory
1211
{
1312
/**

database/factories/NoteFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
66
use Tepuilabs\SimpleCrm\Models\Enums\Note\NotePriority;
7+
use Tepuilabs\SimpleCrm\Models\Lead;
78
use Tepuilabs\SimpleCrm\Models\Note;
8-
9+
use Tepuilabs\SimpleCrm\Tests\Models\User;
910

1011
class NoteFactory extends Factory
1112
{
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
3+
namespace Tepuilabs\SimpleCrm\Database\Factories;
4+
5+
use Illuminate\Database\Eloquent\Factories\Factory;
6+
use Illuminate\Database\Eloquent\Model;
7+
use Tepuilabs\SimpleCrm\Models\Enums\ProjectStatus;
8+
use Tepuilabs\SimpleCrm\Models\Project;
9+
10+
class ProjectFactory extends Factory
11+
{
12+
/**
13+
* The name of the factory's corresponding model.
14+
*
15+
* @var class-string<Model>
16+
*/
17+
protected $model = Project::class;
18+
19+
/**
20+
* Define the model's default state.
21+
*
22+
* @return array
23+
*/
24+
public function definition(): array
25+
{
26+
return [
27+
'title' => $this->faker->jobTitle(),
28+
'description' => $this->faker->paragraphs(),
29+
'deadline' => $this->faker->date(),
30+
'status' => $this->faker->randomElement([
31+
ProjectStatus::OPEN(),
32+
ProjectStatus::CANCELED(),
33+
ProjectStatus::WIP(),
34+
ProjectStatus::BLOCKED(),
35+
ProjectStatus::COMPLETED(),
36+
])
37+
];
38+
}
39+
40+
public function statusOpen()
41+
{
42+
return $this->state([
43+
'status' => ProjectStatus::OPEN()
44+
]);
45+
}
46+
47+
public function statusCanceled()
48+
{
49+
return $this->state([
50+
'status' => ProjectStatus::CANCELED()
51+
]);
52+
}
53+
54+
public function statusWip()
55+
{
56+
return $this->state([
57+
'status' => ProjectStatus::WIP()
58+
]);
59+
}
60+
61+
public function statusBlocked()
62+
{
63+
return $this->state([
64+
'status' => ProjectStatus::BLOCKED()
65+
]);
66+
}
67+
68+
public function statusCompleted()
69+
{
70+
return $this->state([
71+
'status' => ProjectStatus::COMPLETED()
72+
]);
73+
}
74+
}

database/factories/ServiceFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Tepuilabs\SimpleCrm\Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use Illuminate\Database\Eloquent\Model;
76
use Tepuilabs\SimpleCrm\Models\Enums\StatusEnum;
87
use Tepuilabs\SimpleCrm\Models\Service;
98

@@ -17,7 +16,7 @@ class ServiceFactory extends Factory
1716
/**
1817
* {@inheritdoc}
1918
*/
20-
public function definition()
19+
public function definition(): array
2120
{
2221
return [
2322
'name' => $this->faker->sentence(6, true),

0 commit comments

Comments
 (0)