Skip to content

Commit d7bfd64

Browse files
authored
Merge pull request #44 from coderflexx/add_down_migration
remove down migration
2 parents ab85159 + a1a437f commit d7bfd64

File tree

6 files changed

+58
-68
lines changed

6 files changed

+58
-68
lines changed

Diff for: database/migrations/create_tickets_table.php.stub

-10
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,4 @@ return new class extends Migration
2525
$table->timestamps();
2626
});
2727
}
28-
29-
/**
30-
* Reverse the migrations.
31-
*
32-
* @return void
33-
*/
34-
public function down()
35-
{
36-
Schema::dropIfExists('laravel_tickets');
37-
}
3828
};

Diff for: src/Models/Ticket.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
*/
2626
class Ticket extends Model
2727
{
28+
use Concerns\InteractsWithTicketRelations;
29+
use Concerns\InteractsWithTickets;
2830
use HasFactory;
2931
use TicketScope;
30-
use Concerns\InteractsWithTickets;
31-
use Concerns\InteractsWithTicketRelations;
3232

3333
/**
3434
* The attributes that aren't mass assignable.

Diff for: tests/Feature/TicketTest.php

+45-45
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
it('filters tickets by status', function () {
77
Ticket::factory()
8-
->times(3)
9-
->create([
10-
'status' => 'open',
11-
]);
8+
->times(3)
9+
->create([
10+
'status' => 'open',
11+
]);
1212

1313
Ticket::factory()
14-
->times(7)
15-
->create([
16-
'status' => 'closed',
17-
]);
14+
->times(7)
15+
->create([
16+
'status' => 'closed',
17+
]);
1818

1919
Ticket::factory()
20-
->times(6)
21-
->create([
22-
'status' => 'archived',
23-
]);
20+
->times(6)
21+
->create([
22+
'status' => 'archived',
23+
]);
2424

2525
$this->assertEquals(Ticket::count(), 16);
2626
$this->assertEquals(Ticket::opened()->count(), 3);
@@ -31,16 +31,16 @@
3131

3232
it('filters tickets by resolved status', function () {
3333
Ticket::factory()
34-
->times(2)
35-
->create([
36-
'is_resolved' => true,
37-
]);
34+
->times(2)
35+
->create([
36+
'is_resolved' => true,
37+
]);
3838

3939
Ticket::factory()
40-
->times(10)
41-
->create([
42-
'is_resolved' => false,
43-
]);
40+
->times(10)
41+
->create([
42+
'is_resolved' => false,
43+
]);
4444

4545
$this->assertEquals(Ticket::count(), 12);
4646
$this->assertEquals(Ticket::resolved()->count(), 2);
@@ -49,16 +49,16 @@
4949

5050
it('filters tickets by locked status', function () {
5151
Ticket::factory()
52-
->times(3)
53-
->create([
54-
'is_locked' => true,
55-
]);
52+
->times(3)
53+
->create([
54+
'is_locked' => true,
55+
]);
5656

5757
Ticket::factory()
58-
->times(9)
59-
->create([
60-
'is_locked' => false,
61-
]);
58+
->times(9)
59+
->create([
60+
'is_locked' => false,
61+
]);
6262

6363
$this->assertEquals(Ticket::count(), 12);
6464
$this->assertEquals(Ticket::locked()->count(), 3);
@@ -67,28 +67,28 @@
6767

6868
it('filters tickets by priority status', function () {
6969
Ticket::factory()
70-
->times(7)
71-
->create([
72-
'priority' => 'low',
73-
]);
70+
->times(7)
71+
->create([
72+
'priority' => 'low',
73+
]);
7474

7575
Ticket::factory()
76-
->times(5)
77-
->create([
78-
'priority' => 'normal',
79-
]);
76+
->times(5)
77+
->create([
78+
'priority' => 'normal',
79+
]);
8080

8181
Ticket::factory()
82-
->times(15)
83-
->create([
84-
'priority' => 'high',
85-
]);
82+
->times(15)
83+
->create([
84+
'priority' => 'high',
85+
]);
8686

8787
Ticket::factory()
88-
->times(15)
89-
->create([
90-
'priority' => 'something else',
91-
]);
88+
->times(15)
89+
->create([
90+
'priority' => 'something else',
91+
]);
9292

9393
$this->assertEquals(Ticket::count(), 42);
9494
$this->assertEquals(Ticket::withLowPriority()->count(), 7);
@@ -246,7 +246,7 @@
246246
]);
247247

248248
$ticket->archive()
249-
->markAsLocked();
249+
->markAsLocked();
250250

251251
$this->assertTrue($ticket->isArchived());
252252
$this->assertTrue($ticket->isLocked());

Diff for: tests/Models/User.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
use Illuminate\Database\Eloquent\Model;
1515
use Illuminate\Foundation\Auth\Access\Authorizable;
1616

17-
class User extends Model implements CanUseTickets, AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
17+
class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract, CanUseTickets
1818
{
1919
use Authenticatable,
2020
Authorizable,
2121
CanResetPassword,
22-
MustVerifyEmail,
2322
HasFactory,
24-
HasTickets;
23+
HasTickets,
24+
MustVerifyEmail;
2525

2626
protected $guarded = [];
2727
}

Diff for: tests/Unit/LabelTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
$ticket = Ticket::factory()->create();
88

99
$label = Label::factory()
10-
->create([
11-
'name' => 'Support',
12-
'slug' => 'supoort',
13-
]);
10+
->create([
11+
'name' => 'Support',
12+
'slug' => 'supoort',
13+
]);
1414

1515
$tableName = config(
1616
'laravel_ticket.table_names.labels',

Diff for: tests/Unit/MessageTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
);
1515

1616
$message = Message::factory()
17-
->create([
18-
$tableName['columns']['ticket_foreing_id'] => $ticket->id,
19-
'message' => 'Message from a ticket',
20-
]);
17+
->create([
18+
$tableName['columns']['ticket_foreing_id'] => $ticket->id,
19+
'message' => 'Message from a ticket',
20+
]);
2121

2222
$this->assertDatabaseHas($tableName['table'], [
2323
$tableName['columns']['ticket_foreing_id'] => $ticket->id,

0 commit comments

Comments
 (0)