-
Notifications
You must be signed in to change notification settings - Fork 2
Manual Setup
Sahil Parmar edited this page Mar 14, 2023
·
1 revision
composer require kyon147/laravel-shopify
php artisan vendor:publish --tag=shopify-config
<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Osiset\ShopifyApp\Contracts\ShopModel as IShopModel;
use Osiset\ShopifyApp\Traits\ShopModel;
class User extends Authenticatable implements IShopModel
{
use Notifiable;
use ShopModel;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
php artisan migrate
Route::get('/login', [AuthController::class, 'login'])->name('login');
// Please keep this route snippet last
Route::controller(AuthController::class)->group(function (Router $router) {
$router->get('/', 'index')->middleware('verify.shopify')->name('home');
$router->get('/{any}', 'index')->middleware('verify.shopify')->where('any', '(.+)?');
});
NOTE: Please make sure to make your view files as they are in the repo. (You can edit them but they must be present in their respective folders)
You must disable CSRF as there is currently no solution for verifying session tokens with CSRF, there is a conflict due to new login creation each request.
Open \App\Http\Middleware\VerifyCsrfToken.php, and add or edit:
protected $except = [
'*',
];
After these steps, You will be able to scaffold basic shopify app. Follow below instructions for more things.