This file contains 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 | |
//Order Items Migration Fields | |
$table->foreignId('order_id') | |
->constrained() | |
->cascadeOnDelete(); | |
$table->foreignId('product_id') | |
->constrained() |
This file contains 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 | |
Tables\Columns\TextColumn::make('price')->money('BRL'), | |
Tables\Columns\TextColumn::make('created_at')->date('d/m/Y H:i:s') |
This file contains 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
$table->foreignId('tenant_id')->nullable()->constrained(); |
This file contains 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
npm install tailwindcss @tailwindcss/forms @tailwindcss/typography autoprefixer tippy.js --save-dev |
This file contains 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 | |
#up seed | |
$user = \App\Models\User::factory() | |
->hasOrders(1) | |
->create(); | |
$order = $user->orders->first(); |
This file contains 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
<div id="header-content" class="block w-full py-4 border-b border-gray-300"> | |
<h2 class="text-xl font-bold">Criar Produto</h2> | |
</div> | |
<div class="block w-full border-b pb-10 border-gray-300 py-10"> | |
<form action=""> | |
<div class="w-full flex gap-4"> | |
<div class="w-1/2 block mb-6"> | |
<label class="block mb-2">Nome Produto</label> | |
<input | |
type="text" |
This file contains 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
<div id="header-content" class="block w-full py-4 border-b border-gray-300"> | |
<h2 class="text-xl font-bold">Produtos</h2> | |
</div> | |
<div class="block w-full border-b pb-10 border-gray-300"> | |
<table class="w-full text-left"> | |
<thead> | |
<tr> | |
<th class="px-6 py-4">#</th> | |
<th class="px-6 py-4">Produto</th> | |
<th class="px-6 py-4">Preço</th> |
This file contains 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
import httpClient from "@/services/http-client.js"; | |
import storage from "@/services/storage.js"; | |
export default { | |
methods: { | |
logout() { | |
httpClient.post("/logout").then((response) => { | |
storage.remove("token"); | |
location.href = "/auth/login"; | |
}); |
This file contains 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
import { defineStore } from "pinia"; | |
import httpClient from "@/services/http-client"; | |
export const useProducts = defineStore("products", { | |
state: () => ({ products: null }), | |
getters: { | |
getProducts(state) { | |
return state.products; | |
}, | |
}, |
NewerOlder