Dostawa online dla restauracji, produkty, warianty produktów, dodatki, grupy dodatków, koszyk z api, kategorie, zamówienia, płatności payu itp. (przykłady).
app/Models/User.php
<?php
namespace App\Models;
use Cartelo\Models\User as CarteloUser;
class User extends CarteloUser
{
function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->mergeFillable([
// 'mobile', 'website'
]);
$this->mergeCasts([
// 'status' => StatusEnum::class,
// 'email_verified_at' => 'datetime:Y-m-d H:i:s',
]);
// $this->hidden[] = 'secret_hash';
}
protected $dispatchesEvents = [
// 'saved' => UserSaved::class,
// 'deleted' => UserDeleted::class,
];
}
app/Models/Order.php
<?php
namespace App\Models;
use Cartelo\Models\Order as CarteloOrder;
class Order extends CarteloOrder
{
}
config/payu.php
php artisan vendor:publish --tag=payu-config
# Aktualizuj
php artisan migrate
# Nowe
php artisan migrate:fresh
php artisan migrate:fresh --env=testing
php artisan route:list
sudo mkdir -p storage/framework/cache/payu
sudo chown -R www-data:www-data storage/framework/cache/payu
sudo chmod -R 770 storage/framework/cache/payu
use Illuminate\Auth\AuthenticationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
public function register()
{
$this->renderable(function (AuthenticationException $e, $request) {
if ($request->is('web/api/*') || $request->wantsJson()) {
return response()->errors($e->getMessage(), 401);
}
});
$this->renderable(function (NotFoundHttpException $e, $request) {
if ($request->is('web/api/*') || $request->wantsJson()) {
return response()->errors('Not Found.', 404);
}
});
}