0% found this document useful (0 votes)
82 views

Laravel 8 Tips

The document outlines steps to set up a Laravel e-commerce application using Livewire for the frontend. It includes commands to install Laravel, Livewire, Jetstream and a shopping cart package. Models and factories are generated for categories and products. Livewire components are created for the homepage, shop, cart, checkout and admin areas to manage categories, products, pages and more.

Uploaded by

ram deep
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Laravel 8 Tips

The document outlines steps to set up a Laravel e-commerce application using Livewire for the frontend. It includes commands to install Laravel, Livewire, Jetstream and a shopping cart package. Models and factories are generated for categories and products. Livewire components are created for the homepage, shop, cart, checkout and admin areas to manage categories, products, pages and more.

Uploaded by

ram deep
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

composer create-project --prefer-dist laravel/laravel petsgallery

composer require livewire/livewire

{{ $slot }}
{{ asset('') }}

@livewireStyles

@livewireScripts

php artisan make:livewire HomeComponent

use App\Providers\RouteServiceProvider;
add above line in attempttoauthonticate

->layout('layouts.base');

App\Http\Livewire\HomeComponent;

Route::get('/',HomeComponent::class);

php artisan make:livewire ShopComponent

php artisan make:livewire CartComponent

php artisan make:livewire CheckoutComponent

Route::get('/shop',ShopComponent::class);

Route::get('/cart',CartComponent::class);

Route::get('/checkout',CheckoutComponent::class);

App\Http\Livewire\HomeComponent;
App\Http\Livewire\HomeComponent;
App\Http\Livewire\HomeComponent;
App\Http\Livewire\HomeComponent;

composer require laravel/jetstream

php artisan jetstream:install livewire

Route::get('/',HomeComponent::class);

php artisan jetstream:install livewire

$table->string('utype')->default('USR')->comment('ADM for Admin and USR FOR User or


Customer');

php artisan migrate

php artisan make:middleware AuthAdmin

if(session('utype') == 'ADM')
{
return $next($request);
}
else
{
session()->flush();
return redirect()->route('login');
}

if(Auth::user()->utype == 'ADM')
{
session(['utype'=>'ADM']);
return redirect(RouteServiceProvider::HOME);
}
else if(Auth::user()->utype === 'USR')
{
session(['utype'=>'USR']);
return redirect(RouteServiceProvider::HOME);
}

php artisan make:livewire admin/AdminDashboardComponent


php artisan make:livewire user/UserDashboardComponent
@livewire('header-search-component')

composer require hardevine/shoppingcart

Gloudemans\Shoppingcart\ShoppingcartServiceProvider::class,

alices
'Cart'=>Gloudemans\Shoppingcart\Facades\Cart::class,

php artisan vendor:publish --provider="Gloudeman\ShoppingcartServiceProvider"


--tag="config"

php artisan make:model Category -m


php artisan make:model Product -m

php artisan make:factory CategoryFactory --model=Category

php artisan make:livewire DetailsComponent

{{route('product.details',['slug'=>$r_product->slug])}}

AdminCategoryComponent

php artisan make:livewire admin/AdminCategoryComponent


php artisan make:livewire admin/AdminAddCategoryComponent
php artisan make:livewire admin/AdminEditCategoryComponent
php artisan make:livewire admin/AdminAddProductComponent
php artisan make:livewire admin/AdminEditProductComponent
php artisan make:livewire admin/AdminHomeSliderComponent
php artisan make:livewire admin/AdminAddHomeSliderComponent
php artisan make:livewire admin/AdminEditHomeSliderComponent
php artisan make:livewire admin/AdminHomeCategoryComponent
php artisan make:livewire admin/AdminSaleComponent

php artisan livewire:delete PageAddComponent

php artisan make:livewire admin/AdminPageComponent


php artisan make:livewire admin/AdminPageEditComponent
php artisan make:livewire admin/AdminPageAddComponent

You might also like