Skip to content

Instantly share code, notes, and snippets.

View kamaulynder's full-sized avatar
💭
Need great Female Tech Talent, talk to me!!

Linda Kamau kamaulynder

💭
Need great Female Tech Talent, talk to me!!
View GitHub Profile
<div class="fieldgroup">
<div class="form-field legend-with-button">
<legend class="icon-left icon-phone">Phone</legend>
<button class="button-listing" ng-click="$ctrl.showDiv()"><span class="icon-left icon-add">Add phone</span></button>
</div>
<div class="form-field input-with-checkbox" ng-if="phoneForm">
<input type="checkbox" checked />
<a href="" class="control-select">Work</a>
<input type="tel" value="555-555-5555" />
{"message":"405 Method Not Allowed","status_code":405,"debug":{"line":218,"file":"\/home\/vagrant\/rollcall\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/RouteCollection.php","class":"Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException","trace":["#0 \/home\/vagrant\/rollcall\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/RouteCollection.php(205): Illuminate\\Routing\\RouteCollection->methodNotAllowed(Array)","#1 \/home\/vagrant\/rollcall\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/RouteCollection.php(158): Illuminate\\Routing\\RouteCollection->getRouteForMethods(Object(Dingo\\Api\\Http\\Request), Array)","#2 \/home\/vagrant\/rollcall\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php(750): Illuminate\\Routing\\RouteCollection->match(Object(Dingo\\Api\\Http\\Request))","#3 \/home\/vagrant\/rollcall\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/Router.php(659): Illuminate\\Routing\\Router->findRoute(Object(Dingo\\Api\\Http\\Request))","#4
[Request headers] {"Authorization":"Bearer orgadmintoken"}
[Request] GET http://api.rollcall.dev/api/v1/organizations/2
[Response] {"message":"Trying to get property of non-object","status_code":500,"debug":{"line":43,"file":"/home/vagrant/rollcall/app/Repositories/EloquentUserRepository.php","class":"ErrorException","trace":["#0 /home/vagrant/rollcall/app/Repositories/EloquentUserRepository.php(43): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Trying to get p...', '/home/vagrant/r...', 43, Array)","#1 /home/vagrant/rollcall/app/Providers/OAuthServiceProvider.php(19): RollCall\\Repositories\\EloquentUserRepository->find('5')","#2 [internal function]: Rollcall\\Providers\\OAuthServiceProvider->Rollcall\\Providers\\{closure}('5')","#3 /home/vagrant/rollcall/vendor/dingo/api/src/Auth/Provider/OAuth2.php(111): call_user_func(Object(Closure), '5')","#4 /home/vagrant/rollcall/vendor/dingo/api/src/Auth/Provider/OAuth2.php(90): Dingo\\Api\\Auth\\Provider\\OAuth2->resolveResourceOwner(Objec
PHP Fatal error: Cannot use object of type stdClass as array in /home/vagrant/rollcall/app/Traits/UserAccess.php on line 27
PHP Stack trace:
PHP 1. {main}() /home/vagrant/rollcall/vendor/codeception/codeception/codecept:0
PHP 2. Symfony\Component\Console\Application->run() /home/vagrant/rollcall/vendor/codeception/codeception/codecept:27
PHP 3. Symfony\Component\Console\Application->doRun() /home/vagrant/rollcall/vendor/symfony/console/Application.php:120
PHP 4. Symfony\Component\Console\Application->doRunCommand() /home/vagrant/rollcall/vendor/symfony/console/Application.php:189
PHP 5. Symfony\Component\Console\Command\Command->run() /home/vagrant/rollcall/vendor/symfony/console/Application.php:844
PHP 6. Codeception\Command\Run->execute() /home/vagrant/rollcall/vendor/symfony/console/Command/Command.php:256
PHP 7. Codeception\Codecept->run() /home/vagrant/rollcall/vendor/codeception/codeception/src/Codeception/Command/Run.php:187
PHP 8. Codeception\Codecept->runSuite() /home/vagrant/rollcal
[Response] {"message":"Trying to get property of non-object","status_code":500,"debug":{"line":25,"file":"/home/vagrant/rollcall/app/Traits/UserAccess.php","class":"ErrorException","trace":["#0 /home/vagrant/rollcall/app/Traits/UserAccess.php(25): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Trying to get p...', '/home/vagrant/r...', 25, Array)","#1 /home/vagrant/rollcall/app/Http/Requests/User/GetUserRequest.php(20): RollCall\\Http\\Requests\\User\\GetUserRequest->isAdmin()","#2 [internal function]: RollCall\\Http\\Requests\\User\\GetUserRequest->authorize()","#3 /home/vagrant/rollcall/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)","#4 /home/vagrant/rollcall/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php(108): Illuminate\\Container\\Container->call(Array)","#5 /home/vagrant/rollcall/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php(22): Illuminate\\Foundation\\Http\\Form
[Response] {"message":"Trying to get property of non-object","status_code":500,"debug":{"line":25,"file":"/home/vagrant/rollcall/app/Traits/UserAccess.php","class":"ErrorException","trace":["#0 /home/vagrant/rollcall/app/Traits/UserAccess.php(25): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Trying to get p...', '/home/vagrant/r...', 25, Array)","#1 /home/vagrant/rollcall/app/Http/Requests/User/GetUserRequest.php(20): RollCall\\Http\\Requests\\User\\GetUserRequest->isAdmin()","#2 [internal function]: RollCall\\Http\\Requests\\User\\GetUserRequest->authorize()","#3 /home/vagrant/rollcall/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)","#4 /home/vagrant/rollcall/vendor/laravel/framework/src/Illuminate/Foundation/Http/FormRequest.php(108): Illuminate\\Container\\Container->call(Array)","#5 /home/vagrant/rollcall/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php(22): Illuminate\\Foundation\\Http\\Form
<?php
namespace RollCall\Http\Transformers;
use League\Fractal\TransformerAbstract;
class UserTransformer extends TransformerAbstract
{
public function transform(array $user)
{
return [
@@ -15,9 +15,14 @@ class UserCest
$I->sendGET($this->endpoint);
$I->seeResponseCodeIs(200);
$I->seeResponseIsJson();
- $I->seeResponseContainsJson(['name' => 'Test user','email' => '[email protected]']);
- $I->seeResponseContainsJson(['name' => 'Admin user','email' => '[email protected]']);
-
+ $I->seeResponseContainsJson([
+ ['name' => 'Test User',
+ 'email' => '[email protected]'
@@ -8,31 +8,39 @@ class EloquentUserRepository implements UserRepository
{
public function all()
{
- return User::all();
+ $users = User::all();
+
+ return $users->toArray();
}
@@ -8,11 +8,15 @@ use RollCall\Http\Requests\User\CreateUserRequest;
use RollCall\Http\Requests\User\UpdateUserRequest;
use RollCall\Http\Requests\User\GetUsersRequest;
+use RollCall\Http\Transformers\UserTransformer;
+use RollCall\Http\Response;
+
class UserController extends ApiController
{
- public function __construct(UserRepository $users)