Skip to content

Commit b79f3be

Browse files
committed
Fixed what needed fixing and squished some bugs. 🐛
1 parent 3863f9e commit b79f3be

File tree

9 files changed

+32
-17
lines changed

9 files changed

+32
-17
lines changed

README.md

Lines changed: 1 addition & 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,7 +31,7 @@ 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
}
4236
```
4337

database/factories/LeadFactory.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
class LeadFactory extends Factory
99
{
10+
/**
11+
* The name of the factory's corresponding model.
12+
*
13+
* @var class-string<\Illuminate\Database\Eloquent\Model>
14+
*/
1015
protected $model = \Tepuilabs\SimpleCrm\Models\Lead::class;
1116

1217
const ORGANIC_TYPE = 'Organic';
@@ -17,6 +22,11 @@ class LeadFactory extends Factory
1722
const CUSTOMER_STATUS = 'Customer';
1823

1924

25+
/**
26+
* Define the model's default state.
27+
*
28+
* @return array
29+
*/
2030
public function definition()
2131
{
2232
return [

database/factories/NoteFactory.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@
77

88
class NoteFactory extends Factory
99
{
10+
/**
11+
* The name of the factory's corresponding model.
12+
*
13+
* @var class-string<\Illuminate\Database\Eloquent\Model>
14+
*/
1015
protected $model = \Tepuilabs\SimpleCrm\Models\Note::class;
1116

1217
const LOW_PRIORITY = 'Low';
1318
const MEDIUM_PRIORITY = 'Medium';
1419
const HIGH_PRIORITY = 'High';
1520

1621

22+
/**
23+
* Define the model's default state.
24+
*
25+
* @return array
26+
*/
1727
public function definition()
1828
{
1929
$author = \Tepuilabs\SimpleCrm\Tests\Models\User::factory()->create();

database/factories/ServiceFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class ServiceFactory extends Factory
99
/**
1010
* The name of the factory's corresponding model.
1111
*
12-
* @var string
12+
* @var class-string<\Illuminate\Database\Eloquent\Model>
1313
*/
1414
protected $model = \Tepuilabs\SimpleCrm\Models\Service::class;
1515

database/factories/UserFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ class UserFactory extends Factory
1010
/**
1111
* The name of the factory's corresponding model.
1212
*
13-
* @var string
13+
* @var class-string<\Illuminate\Database\Eloquent\Model>
1414
*/
1515
protected $model = \Tepuilabs\SimpleCrm\Tests\Models\User::class;
1616

17+
1718
/**
1819
* Define the model's default state.
1920
*

src/Models/Lead.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Lead extends Model
2323
/**
2424
* The attributes that are mass assignable.
2525
*
26-
* @var array
26+
* @var array<int, string>
2727
*/
2828
protected $fillable = [
2929
'name',
@@ -39,7 +39,7 @@ class Lead extends Model
3939
*/
4040
public function notes(): HasMany
4141
{
42-
return $this->hasMany(\App\Models\Tepuilabs\SimpleCrm\Note::class);
42+
return $this->hasMany(\Tepuilabs\SimpleCrm\Models\Note::class);
4343
}
4444

4545
/**

src/Models/Note.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Note extends Model
1818
/**
1919
* The attributes that are mass assignable.
2020
*
21-
* @var array
21+
* @var array<int, string>
2222
*/
2323
protected $fillable = [
2424
'priority',
@@ -33,7 +33,7 @@ public function author(): MorphTo
3333

3434
public function lead(): BelongsTo
3535
{
36-
return $this->belongsTo(\App\Models\Tepuilabs\SimpleCrm\Lead::class);
36+
return $this->belongsTo(\Tepuilabs\SimpleCrm\Models\Lead::class);
3737
}
3838

3939
public static function getPriorities(): array

src/Models/Service.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Service extends Model
1212
/**
1313
* The attributes that are mass assignable.
1414
*
15-
* @var array
15+
* @var array<int, string>
1616
*/
1717
protected $fillable = [
1818
'name',

tests/Models/User.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class User extends Authenticatable
1414
/**
1515
* The attributes that are mass assignable.
1616
*
17-
* @var array
17+
* @var array<int, string>
1818
*/
1919
protected $fillable = [
2020
'name',
@@ -25,7 +25,7 @@ class User extends Authenticatable
2525
/**
2626
* The attributes that should be hidden for arrays.
2727
*
28-
* @var array
28+
* @var array<int, string>
2929
*/
3030
protected $hidden = [
3131
'password',
@@ -35,7 +35,7 @@ class User extends Authenticatable
3535
/**
3636
* The attributes that should be cast to native types.
3737
*
38-
* @var array
38+
* @var array<int, string>
3939
*/
4040
protected $casts = [
4141
'email_verified_at' => 'datetime',

0 commit comments

Comments
 (0)