Skip to content

Commit

Permalink
Merge branch 'main' of github.com:starfolksoftware/ally into main
Browse files Browse the repository at this point in the history
  • Loading branch information
frknasir committed Apr 19, 2022
2 parents 186f4c0 + a270a3e commit ed829a3
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/Actions/CreateContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace StarfolkSoftware\Ally\Actions;

use Illuminate\Support\Facades\Validator;
use StarfolkSoftware\Ally\Contracts\CreatesContacts;
use StarfolkSoftware\Ally\Ally;
use StarfolkSoftware\Ally\Contracts\CreatesContacts;

class CreateContact implements CreatesContacts
{
Expand Down Expand Up @@ -44,4 +44,4 @@ public function __invoke($user, array $data, $teamId = null)
Ally::findTeamByIdOrFail($teamId)->contacts()->create($fields) :
Ally::newContactModel()->create($fields);
}
}
}
4 changes: 2 additions & 2 deletions src/Actions/DeleteContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace StarfolkSoftware\Ally\Actions;

use StarfolkSoftware\Ally\Ally;
use StarfolkSoftware\Ally\Contact;
use StarfolkSoftware\Ally\Contracts\DeletesContacts;
use StarfolkSoftware\Ally\Ally;

class DeleteContact implements DeletesContacts
{
Expand All @@ -27,4 +27,4 @@ public function __invoke($user, Contact $contact)

$contact->delete();
}
}
}
4 changes: 2 additions & 2 deletions src/Actions/UpdateContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace StarfolkSoftware\Ally\Actions;

use Illuminate\Support\Facades\Validator;
use StarfolkSoftware\Ally\Ally;
use StarfolkSoftware\Ally\Contact;
use StarfolkSoftware\Ally\Contracts\UpdatesContacts;
use StarfolkSoftware\Ally\Ally;

class UpdateContact implements UpdatesContacts
{
Expand Down Expand Up @@ -44,4 +44,4 @@ public function __invoke($user, Contact $contact, array $data)

return $contact->refresh();
}
}
}
1 change: 0 additions & 1 deletion src/AllyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use StarfolkSoftware\Ally\Actions\CreateContact;
use StarfolkSoftware\Ally\Actions\DeleteContact;
use StarfolkSoftware\Ally\Actions\UpdateContact;
use StarfolkSoftware\Ally\Commands\AllyCommand;
use StarfolkSoftware\Ally\Commands\InstallCommand;

class AllyServiceProvider extends PackageServiceProvider
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ protected function installServiceProviderAfter($after, $name)
));
}
}
}
}
2 changes: 1 addition & 1 deletion src/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public function entries(string $class): MorphToMany
'id'
);
}
}
}
2 changes: 1 addition & 1 deletion src/Contracts/CreatesContacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ interface CreatesContacts
* @return \StarfolkSoftware\Ally\Contact
*/
public function __invoke($user, array $data, $teamId = null);
}
}
2 changes: 1 addition & 1 deletion src/Contracts/UpdatesContacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ interface UpdatesContacts
* @return \StarfolkSoftware\Ally\Contact
*/
public function __invoke($user, Contact $contact, array $data);
}
}
2 changes: 1 addition & 1 deletion src/HasContacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ protected function prepareContactIds($contacts): array

return (array) $contacts;
}
}
}
4 changes: 2 additions & 2 deletions src/Http/Controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace StarfolkSoftware\Ally\Http\Controllers;

use StarfolkSoftware\Ally\Ally;
use StarfolkSoftware\Ally\Contact;
use StarfolkSoftware\Ally\Contracts\CreatesContacts;
use StarfolkSoftware\Ally\Contracts\DeletesContacts;
use StarfolkSoftware\Ally\Contracts\UpdatesContacts;
use StarfolkSoftware\Ally\Ally;

class ContactController extends Controller
{
Expand Down Expand Up @@ -66,4 +66,4 @@ public function destroy(Contact $contact, DeletesContacts $deletesContacts)
request()->get('redirect', Ally::redirects('destroy', '/'))
);
}
}
}
2 changes: 1 addition & 1 deletion src/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class Controller extends BaseController
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}
}
2 changes: 1 addition & 1 deletion tests/Feature/Actions/CreateContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@

expect($tax->refresh())
->name->toBe('Contact');
});
});
4 changes: 2 additions & 2 deletions tests/Feature/Actions/CreateContactWithTeamTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use StarfolkSoftware\Ally\Contracts\CreatesContacts;
use StarfolkSoftware\Ally\Ally;
use StarfolkSoftware\Ally\Contracts\CreatesContacts;
use StarfolkSoftware\Ally\Tests\Mocks\TeamModel;
use StarfolkSoftware\Ally\Tests\Mocks\TestUser;

Expand Down Expand Up @@ -48,4 +48,4 @@

expect($team->refresh()->contacts()->count())
->toBe(1);
});
});
2 changes: 1 addition & 1 deletion tests/Feature/Actions/DeleteContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
$deletesContacts($user, $category);

expect(Contact::count())->toEqual(0);
});
});
2 changes: 1 addition & 1 deletion tests/Feature/Actions/UpdateContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@

expect($contact->refresh())
->name->toBe('Contact');
});
});
2 changes: 1 addition & 1 deletion tests/Feature/ContactTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
$response->assertRedirect('/redirect/path');

expect(Contact::count())->toEqual(0);
});
});
2 changes: 1 addition & 1 deletion tests/Feature/HasContactsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
expect($product->contacts()->count())->toBe(0);

expect(TestProduct::withoutAnyContacts()->count())->toBe(5);
});
});
2 changes: 1 addition & 1 deletion tests/Mocks/TeamModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class TeamModel extends Model
use TeamHasContacts;

protected $table = 'teams';
}
}
2 changes: 1 addition & 1 deletion tests/Mocks/TestProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class TestProduct extends Model
use HasContacts;

protected $table = 'products';
}
}
2 changes: 1 addition & 1 deletion tests/Mocks/TestUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
class TestUser extends User
{
protected $table = 'users';
}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ protected function createUser()
'password' => 'test',
]);
}
}
}

0 comments on commit ed829a3

Please sign in to comment.