Add Cart model, resource and its API, Pivot table with Items.

Update Items model to have relationship with cart.
This commit is contained in:
2023-06-15 17:43:59 +03:00
parent ea363b956e
commit 4a4d5e7335
12 changed files with 388 additions and 0 deletions
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Cart;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class CartPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
//
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Cart $cart): bool
{
//
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
//
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Cart $cart): bool
{
//
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Cart $cart): bool
{
//
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Cart $cart): bool
{
//
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Cart $cart): bool
{
//
}
}