-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added sweetalerts, auth policy, images to s3, error views, edit and d…
…elete methods
- Loading branch information
1 parent
c9781fc
commit dd54c56
Showing
44 changed files
with
13,453 additions
and
9,345 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
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,72 @@ | ||
<?php | ||
|
||
namespace App\Policies; | ||
|
||
use App\Post; | ||
use App\User; | ||
use Illuminate\Support\Facades\Auth; | ||
use Illuminate\Auth\Access\HandlesAuthorization; | ||
|
||
class PostPolicy | ||
{ | ||
use HandlesAuthorization; | ||
|
||
/** | ||
* Determine whether the user can view the post. | ||
* | ||
* @param \App\User $user | ||
* @param \App\Post $post | ||
* @return mixed | ||
*/ | ||
public function view(User $user, Post $post) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Determine whether the user can create posts. | ||
* | ||
* @param \App\User $user | ||
* @return mixed | ||
*/ | ||
public function create(User $user) | ||
{ | ||
return Auth::check(); | ||
} | ||
|
||
/** | ||
* Determine whether the user can update the post. | ||
* | ||
* @param \App\User $user | ||
* @param \App\Post $post | ||
* @return mixed | ||
*/ | ||
public function edit(User $user, Post $post) | ||
{ | ||
return $user->id === $post->user_id; | ||
} | ||
|
||
/** | ||
* Determine whether the user can update the post. | ||
* | ||
* @param \App\User $user | ||
* @param \App\Post $post | ||
* @return mixed | ||
*/ | ||
public function update(User $user, Post $post) | ||
{ | ||
return $user->id === $post->user_id; | ||
} | ||
|
||
/** | ||
* Determine whether the user can delete the post. | ||
* | ||
* @param \App\User $user | ||
* @param \App\Post $post | ||
* @return mixed | ||
*/ | ||
public function delete(User $user, Post $post) | ||
{ | ||
return $user->id === $post->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 was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,8 @@ | |
"laravel-mix": "^0.8.3", | ||
"lodash": "^4.17.4", | ||
"vue": "^2.1.10" | ||
}, | ||
"dependencies": { | ||
"sweetalert": "^1.1.3" | ||
} | ||
} |
Oops, something went wrong.