Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7aee70
commit 8a388cc
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Policies; | ||
|
||
use App\Reply; | ||
use App\User; | ||
use Illuminate\Auth\Access\HandlesAuthorization; | ||
|
||
class ReplyPolicy | ||
{ | ||
use HandlesAuthorization; | ||
|
||
/** | ||
* Determine if the authenticated user has permission to update a reply. | ||
* | ||
* @param User $user | ||
* @param Reply $reply | ||
* @return bool | ||
*/ | ||
public function update(User $user, Reply $reply) | ||
{ | ||
return $reply->user_id == $user->id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8a388cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting
"Expected status code 403 but received 404.
Failed asserting that false is true."
and
"Expected status code 302 but received 404.
Failed asserting that false is true."
for those 2 tests on writing the exact code.
But works fine in browser and deletes in the database as well, only these test fail.
Can you please help me know as to why that is?