import app Models User change
This commit is contained in:
@@ -4,7 +4,7 @@ namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
@@ -60,7 +60,7 @@ class RegisterController extends Controller
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\User
|
||||
* @return \App\Models\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ use App\Http\Requests\EventRequest;
|
||||
use App\Models\Event;
|
||||
use App\Http\Resources\Event as EventResource;
|
||||
use App\Models\EventGuestsNonUsers;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EventController extends Controller
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Resources\Image as ImageResource;
|
||||
use App\Models\Memo;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Intervention\Image\Facades\Image;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Jobs\SendMailNewUserJob;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use App\Http\Resources\User as UserResource;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Http\Resources\User as UserResource;
|
||||
use App\Http\Resources\EventCategory as EventCategoryRessource;
|
||||
use App\Http\Resources\EventCategory as EventCategoryResource;
|
||||
use App\Http\Resources\EventGuestWithoutEmail as GuestsWithoutEmailResource;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
@@ -28,7 +28,7 @@ class Event extends JsonResource
|
||||
'start_date' => $this->start_date,
|
||||
'end_date' => $this->end_date,
|
||||
'location' => $this->location,
|
||||
'category' => new EventCategoryRessource($this->category),
|
||||
'category' => new EventCategoryResource($this->category),
|
||||
'invitations' => UserResource::collection($this->guests),
|
||||
'invitations-with-email' => [
|
||||
'data' => GuestsWithoutEmailResource::collection($this->emailedGuests)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Mail\NewUserInvitation;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Bookmark;
|
||||
use App\Models\Event;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Bookmark;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class BookmarkPolicy
|
||||
@@ -13,7 +13,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can view any bookmarks.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
@@ -24,7 +24,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can view the bookmark.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Bookmark $bookmark
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can create bookmarks.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function create(User $user)
|
||||
@@ -47,7 +47,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can update the bookmark.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Bookmark $bookmark
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can delete the bookmark.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Bookmark $bookmark
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can restore the bookmark.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Bookmark $bookmark
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ class BookmarkPolicy
|
||||
/**
|
||||
* Determine whether the user can permanently delete the bookmark.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Bookmark $bookmark
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class EventPolicy
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\Memo;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class MemoPolicy
|
||||
@@ -13,7 +13,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can view any memos.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
@@ -24,7 +24,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can view the memo.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Memo $memo
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can create memos.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function create(User $user)
|
||||
@@ -47,7 +47,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can update the memo.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Memo $memo
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can delete the memo.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Memo $memo
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can restore the memo.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Memo $memo
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ class MemoPolicy
|
||||
/**
|
||||
* Determine whether the user can permanently delete the memo.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\Memo $memo
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Models\ToDoList;
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class ToDoListPolicy
|
||||
@@ -13,7 +13,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can view any to do lists.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
@@ -24,7 +24,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can view the to do list.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\ToDoList $toDoList
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can create to do lists.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function create(User $user)
|
||||
@@ -47,7 +47,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can update the to do list.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\ToDoList $toDoList
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -59,7 +59,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can delete the to do list.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\ToDoList $toDoList
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can restore the to do list.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\ToDoList $toDoList
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ class ToDoListPolicy
|
||||
/**
|
||||
* Determine whether the user can permanently delete the to do list.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\ToDoList $toDoList
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class UserPolicy
|
||||
@@ -12,7 +12,7 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function viewAny(User $user)
|
||||
@@ -23,8 +23,8 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\User $model
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\User $model
|
||||
* @return mixed
|
||||
*/
|
||||
public function view(User $user, User $model)
|
||||
@@ -35,7 +35,7 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function create(User $user)
|
||||
@@ -46,8 +46,8 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\User $model
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\User $model
|
||||
* @return mixed
|
||||
*/
|
||||
public function update(User $user, User $model)
|
||||
@@ -58,8 +58,8 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\User $model
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\User $model
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete(User $user, User $model)
|
||||
@@ -70,8 +70,8 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can restore the model.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\User $model
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\User $model
|
||||
* @return mixed
|
||||
*/
|
||||
public function restore(User $user, User $model)
|
||||
@@ -82,8 +82,8 @@ class UserPolicy
|
||||
/**
|
||||
* Determine whether the user can permanently delete the model.
|
||||
*
|
||||
* @param \App\User $user
|
||||
* @param \App\User $model
|
||||
* @param \App\Models\User $user
|
||||
* @param \App\Models\User $model
|
||||
* @return mixed
|
||||
*/
|
||||
public function forceDelete(User $user, User $model)
|
||||
|
||||
@@ -15,7 +15,7 @@ class AuthServiceProvider extends ServiceProvider
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Model' => 'App\Policies\ModelPolicy',
|
||||
'App\User' => 'App\Policies\UserPolicy',
|
||||
'App\Models\User' => 'App\Policies\UserPolicy',
|
||||
'App\Models\Memo' => 'App\Policies\MemoPolicy',
|
||||
'App\Models\ToDoList' => 'App\Policies\ToDoListPolicy',
|
||||
'App\Models\Bookmark' => 'App\Policies\BookmarkPolicy',
|
||||
|
||||
Reference in New Issue
Block a user