This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Front; | |
use App\Http\Controllers\Controller; | |
use App\Models\Store; | |
use App\Services\CartService; | |
use Illuminate\Http\Request; | |
class StoresController extends Controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\App\Models\Tenant::factory(10) | |
->hasStores(1) | |
->create(); | |
foreach(\App\Models\Store::all() as $store) { | |
$tenantAndStoreIds = ['store_id' => $store->id, 'tenant_id' => $store->tenant_id]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\Admin; | |
use App\Models\Category; | |
use App\Models\Store; | |
use Illuminate\Http\Request; | |
class CategoriesController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Conteúdo método store product | |
$data = $request->all(); | |
$product = $store->first()->products()->create($data); | |
$product->categories()->sync($request->categories); | |
session()->flash('message', ['type' => 'success', 'body' => 'Sucesso ao cadastrar produto']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<x-app-layout> | |
<x-slot name="header"> | |
<h2 class="font-semibold text-xl text-gray-800 leading-tight"> | |
{{ __('Criar Produto') }} | |
</h2> | |
</x-slot> | |
<div class="py-12"> | |
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> | |
<div class="flex flex-col"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$table->unsignedBigInteger('tenant_id')->nullable(); | |
$table->unsignedBigInteger('store_id')->nullable(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsl --list --verbose | |
wsl --set-version <DISTRO> <VERSION: 1 , 2> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO produtos (nome, descricao, sobre, preco, status, criado_em, atualizado_em) | |
VALUES | |
('Produto Teste 3', 'Descrição Teste', 'Sobre o produto teste...', 129.89, 1, NOW(), NOW()), | |
('Produto Teste 4', 'Descrição Teste', 'Sobre o produto teste...', 29.9, 1, NOW(), NOW()), | |
('Produto Teste 5', 'Descrição Teste', 'Sobre o produto teste...', 39.45, 1, NOW(), NOW()), | |
('Produto Teste 6', 'Descrição Teste', 'Sobre o produto teste...', 19.9, 0, NOW(), NOW()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('/watch/{video:code}',\App\Http\Livewire\Player::class)->middleware('auth')->name('video.player'); | |
Route::get('resources/{code}/{video}', function($code, $video = null) { | |
return \Illuminate\Support\Facades\Storage::disk('videos_processed') | |
->response( | |
$video, null, [ | |
'Content-Type' => 'application/x-mpegURL', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Livewire; | |
use Livewire\Component; | |
use App\Models\Video; | |
class Player extends Component | |
{ | |
public $video; |