nonprint
parent
bef9333795
commit
3ab49230f3
|
@ -31,19 +31,24 @@ class CreateRoutePermissionCommand extends Command
|
|||
$routes = Route::getRoutes()->getRoutesByName();
|
||||
// dd($routes);
|
||||
foreach ($routes as $route) {
|
||||
if ($route->getName() != '' && count($route->getAction()['middleware']) >= 2) {
|
||||
$permission = Permission::where('name', $route->getName())->first();
|
||||
|
||||
$data = $route->getName();
|
||||
[$first_group] = explode('.', $data);
|
||||
$comment = $route->getComment();
|
||||
if (is_null($comment)) {
|
||||
$comment = Str::title(str_replace('.', ' ', $route->getName()));
|
||||
}
|
||||
if (is_null($permission)) {
|
||||
permission::create(['name' => $data, 'group_name' => $first_group, 'desc' => $comment]);
|
||||
$this->info('Permission routes ' . $route->getName() . ' added successfully.');
|
||||
try {
|
||||
if ($route->getName() != '' && count($route->getAction()['middleware']) >= 2) {
|
||||
$permission = Permission::where('name', $route->getName())->first();
|
||||
$data = $route->getName();
|
||||
[$first_group] = explode('.', $data);
|
||||
$comment = $route->getComment();
|
||||
if (is_null($comment)) {
|
||||
$comment = Str::title(str_replace('.', ' ', $route->getName()));
|
||||
}
|
||||
if (is_null($permission)) {
|
||||
permission::create(['name' => $data, 'group_name' => $first_group, 'desc' => $comment]);
|
||||
$this->info('Permission routes ' . $route->getName() . ' added successfully.');
|
||||
}
|
||||
} else {
|
||||
$this->info('Permission routes ' . $route->getName() . ' not added.');
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$this->info('Permission routes ' . $route->getName() . ' not added.');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use App\Models\RekeningCoa;
|
|||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class PenjualanController extends Controller
|
||||
{
|
||||
|
@ -26,7 +27,7 @@ class PenjualanController extends Controller
|
|||
$filter_tanggal_2 = $request->filter_tanggal_2;
|
||||
$akun_coa = $request->akun_coa;
|
||||
if ($request->akun_coa == null) {
|
||||
$data = Pesanan::with(['detailPesanan', 'user', 'rekening_coa'])
|
||||
$data = Pesanan::with(['detailPesanan', 'user'])
|
||||
->when($filter_tanggal_1, function ($query) use ($filter_tanggal_1) {
|
||||
return $query->whereDate('tanggal_pesanan', '>=', $filter_tanggal_1);
|
||||
})
|
||||
|
@ -76,7 +77,7 @@ class PenjualanController extends Controller
|
|||
return 'Rp ' . number_format($data->grand_total, 0, ',', '.');
|
||||
})
|
||||
->addColumn('jenis_pembayarannya', function ($data) {
|
||||
return $data->jenis_pembayaran == 1 ? 'Tunai' : 'Non-Tunai' . ' (' . $data->rekening_coa->keterangan_coa . ')';
|
||||
return $data->jenis_pembayaran == 1 ? 'Tunai' : ($data->jenis_pembayaran == null ? 'Tunai' : 'Non-Tunai' . ' (' . ($data->rekening_coa?->keterangan_coa ?? '') . ')');
|
||||
})
|
||||
->addColumn('ubah', function ($data) {
|
||||
return '<div class="btn-group">
|
||||
|
@ -103,44 +104,61 @@ class PenjualanController extends Controller
|
|||
|
||||
public function laporan(Request $request)
|
||||
{
|
||||
$mpdf = new \Mpdf\Mpdf([
|
||||
'mode' => 'utf-8',
|
||||
'format' => 'A4',
|
||||
'orientation' => 'portrait',
|
||||
'margin_left' => 15,
|
||||
'margin_right' => 15,
|
||||
'margin_top' => 10,
|
||||
'margin_bottom' => 10,
|
||||
'default_font_size' => 9,
|
||||
'default_font' => 'arial',
|
||||
]);
|
||||
$mpdf->AddPage();
|
||||
$mpdf->setFooter('{PAGENO}');
|
||||
try {
|
||||
$mpdf = new \Mpdf\Mpdf([
|
||||
'mode' => 'utf-8',
|
||||
'format' => 'A4',
|
||||
'orientation' => 'portrait',
|
||||
'margin_left' => 15,
|
||||
'margin_right' => 15,
|
||||
'margin_top' => 10,
|
||||
'margin_bottom' => 10,
|
||||
'default_font_size' => 9,
|
||||
'default_font' => 'arial',
|
||||
]);
|
||||
$mpdf->AddPage();
|
||||
$mpdf->setFooter('{PAGENO}');
|
||||
$filter_tanggal_1 = $request->filter_tanggal_1;
|
||||
$filter_tanggal_2 = $request->filter_tanggal_2;
|
||||
if ($request->jenis_coa == null) {
|
||||
$keterangan_coa = 'Semua';
|
||||
$data = Pesanan::with(['user', 'bukuBesar', 'rekening_coa'])->whereDate('tanggal_pesanan', '>=', $request->filter_tanggal_1)
|
||||
->whereDate('tanggal_pesanan', '<=', $request->filter_tanggal_2)
|
||||
->get();
|
||||
} else {
|
||||
$keterangan_coa = RekeningCoa::find($request->jenis_coa)->keterangan_coa;
|
||||
$data = Pesanan::with(['user', 'bukuBesar', 'rekening_coa'])->where('rekening_coa_id', $request->jenis_coa)->whereDate('tanggal_pesanan', '>=', $request->filter_tanggal_1)
|
||||
->whereDate('tanggal_pesanan', '<=', $request->filter_tanggal_2)
|
||||
->get();
|
||||
}
|
||||
|
||||
$filter_tanggal_1 = $request->filter_tanggal_1;
|
||||
$filter_tanggal_2 = $request->filter_tanggal_2;
|
||||
if ($request->jenis_coa == null) {
|
||||
$keterangan_coa = 'Semua';
|
||||
$data = Pesanan::with(['user', 'bukuBesar', 'rekening_coa'])->whereDate('tanggal_pesanan', '>=', $request->filter_tanggal_1)
|
||||
->whereDate('tanggal_pesanan', '<=', $request->filter_tanggal_2)
|
||||
->get();
|
||||
} else {
|
||||
$keterangan_coa = RekeningCoa::find($request->jenis_coa)->keterangan_coa;
|
||||
$data = Pesanan::with(['user', 'bukuBesar', 'rekening_coa'])->where('rekening_coa_id', $request->jenis_coa)->whereDate('tanggal_pesanan', '>=', $request->filter_tanggal_1)
|
||||
->whereDate('tanggal_pesanan', '<=', $request->filter_tanggal_2)
|
||||
->get();
|
||||
$alldata = [
|
||||
'data' => $data,
|
||||
'filter_tanggal_1' => $filter_tanggal_1,
|
||||
'filter_tanggal_2' => $filter_tanggal_2,
|
||||
'keterangan_coa' => $keterangan_coa
|
||||
];
|
||||
|
||||
$html = view('pages.admin.penjualan.laporan', $alldata);
|
||||
// $html->render();
|
||||
// $mpdf->WriteHTML($html);
|
||||
|
||||
// $mpdf->chunkLoadView('<html-separator/>', 'pages.admin.penjualan.laporan', $alldata);
|
||||
// return $mpdf->stream('document.pdf');
|
||||
|
||||
$chunks = explode("chunk", (string)$html);
|
||||
foreach ($chunks as $key => $val) {
|
||||
// $mpdf->WriteHTML($val);
|
||||
}
|
||||
$mpdf->writeHTML($html);
|
||||
|
||||
$mpdf->Output('Laporan_Penjualan.pdf', 'I');
|
||||
return response()->header('Content-Type', 'application/pdf');
|
||||
} catch (\Throwable $th) {
|
||||
Session::flash('errors', 'Gagal membuat laporan, coba lagi dengan rentang tanggal yang lebih pendek');
|
||||
return redirect()->back();
|
||||
//throw $th;
|
||||
}
|
||||
|
||||
$html = view('pages.admin.penjualan.laporan', [
|
||||
'data' => $data,
|
||||
'filter_tanggal_1' => $filter_tanggal_1,
|
||||
'filter_tanggal_2' => $filter_tanggal_2,
|
||||
'keterangan_coa' => $keterangan_coa
|
||||
]);
|
||||
$mpdf->writeHTML($html);
|
||||
|
||||
$mpdf->Output('Laporan_Penjualan.pdf', 'I');
|
||||
return response()->header('Content-Type', 'application/pdf');
|
||||
}
|
||||
|
||||
public function cancel(Request $request)
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admins\PerangkatPrinter;
|
||||
|
||||
use App\Helpers\ResponseFormatter;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\PerangkatPrinter;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Mpdf\Tag\Q;
|
||||
|
||||
class PerangkatPrinterController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('pages.admin.perangkat_printer.index');
|
||||
}
|
||||
|
||||
|
||||
public function getDataPrinter()
|
||||
{
|
||||
$data = PerangkatPrinter::get();
|
||||
|
||||
return datatables()->of($data)
|
||||
->addColumn('status_printer', function ($data) {
|
||||
if ($data->status == '1') {
|
||||
return '<span class="badge badge-success">Aktif</span>';
|
||||
} else {
|
||||
return '<span class="badge badge-danger">Tidak Aktif</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
return '
|
||||
<button class="btn btn-sm btn-warning btn-edit-printer" data-printer=' . $data . '><i class="fas fa-edit"></i></button>
|
||||
<button class="btn btn-sm btn-danger btn-hapus-printer" data-printer=' . $data . '><i class="fas fa-trash"></i></button>
|
||||
';
|
||||
})
|
||||
->rawColumns(['action' => 'action', 'status_printer' => 'status_printer'])
|
||||
->addIndexColumn()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
// validation
|
||||
$validator = Validator::make($request->all(), [
|
||||
'printer_nama' => 'required',
|
||||
'printer_mm' => 'required',
|
||||
'printer_for' => 'required',
|
||||
], [
|
||||
'printer_nama.required' => 'Nama tidak boleh kosong!',
|
||||
'printer_mm.required' => 'Ukuran kertas printer tidak boleh kosong!',
|
||||
'printer_for.required' => 'Printer digunakan untuk tidak boleh kosong!',
|
||||
]);
|
||||
|
||||
// check validation
|
||||
if ($validator->fails()) {
|
||||
return ResponseFormatter::error($validator->errors()->first());
|
||||
}
|
||||
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
if ($request->printer_status != 'on' || $request->printer_status == null) {
|
||||
$status = '0';
|
||||
} else {
|
||||
$status = '1';
|
||||
}
|
||||
|
||||
// create new account
|
||||
$printer = PerangkatPrinter::create([
|
||||
'nama_printer' => $request->printer_nama,
|
||||
'printer_connection' => $request->printer_connection,
|
||||
'ip_address' => $request->ip_address,
|
||||
'printer_mm' => $request->printer_mm,
|
||||
'printer_for' => $request->printer_for,
|
||||
'status' => $status,
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
return ResponseFormatter::success($printer, "Printer berhasil ditambahkan");
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
return ResponseFormatter::error($th->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
// get data from printer
|
||||
$printer = PerangkatPrinter::findOrFail($id);
|
||||
return ResponseFormatter::success([
|
||||
'printer' => $printer
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
|
||||
// validation
|
||||
$validator = Validator::make($request->all(), [
|
||||
'printer_nama_edit' => 'required',
|
||||
'printer_mm_edit' => 'required',
|
||||
'printer_for_edit' => 'required',
|
||||
], [
|
||||
'printer_nama_edit.required' => 'Nama tidak boleh kosong!',
|
||||
'printer_mm_edit.required' => 'Ukuran kertas printer tidak boleh kosong!',
|
||||
'printer_for_edit.required' => 'Printer digunakan untuk tidak boleh kosong!'
|
||||
]);
|
||||
|
||||
// check validation
|
||||
if ($validator->fails()) {
|
||||
return ResponseFormatter::error($validator->errors()->first());
|
||||
}
|
||||
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
if ($request->printer_status_edit != 'on' || $request->printer_status_edit == null) {
|
||||
$status = '0';
|
||||
} else {
|
||||
$status = '1';
|
||||
}
|
||||
|
||||
// create new account
|
||||
$printer = PerangkatPrinter::findOrFail($id);
|
||||
$printer->update([
|
||||
'nama_printer' => $request->printer_nama_edit,
|
||||
'printer_connection' => $request->printer_connection,
|
||||
'ip_address' => $request->ip_address,
|
||||
'printer_mm' => $request->printer_mm_edit,
|
||||
'printer_for' => $request->printer_for_edit,
|
||||
'status' => $status,
|
||||
]);
|
||||
|
||||
DB::commit();
|
||||
return ResponseFormatter::success($printer, "Printer berhasil diubah");
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollBack();
|
||||
return ResponseFormatter::error($th->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
// get data from printer
|
||||
$printer = PerangkatPrinter::findOrFail($id);
|
||||
|
||||
// check printer
|
||||
if (!$printer) {
|
||||
return ResponseFormatter::error("Data printer tidak ditemukan!");
|
||||
}
|
||||
|
||||
// delete printer
|
||||
$printer->delete();
|
||||
|
||||
return ResponseFormatter::success(null, "Printer berhasil dihapus!");
|
||||
}
|
||||
}
|
|
@ -16,11 +16,12 @@ class Menu extends Controller
|
|||
public function index()
|
||||
{
|
||||
$kategori_produks = KategoriProduk::get();
|
||||
|
||||
return view('pages.Menu.index', compact('kategori_produks'));
|
||||
$kelompok_kategoris = KelompokKategori::get();
|
||||
return view('pages.Menu.index', compact('kategori_produks', 'kelompok_kategoris'));
|
||||
}
|
||||
|
||||
public function kelompokKategori($id) {
|
||||
public function kelompokKategori($id)
|
||||
{
|
||||
$kelompok_kategoris = KelompokKategori::where('kategori_produk_id', $id)->get();
|
||||
|
||||
if (empty($kelompok_kategoris[0])) {
|
||||
|
@ -28,13 +29,23 @@ class Menu extends Controller
|
|||
} else {
|
||||
return $kelompok_kategoris;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getDataMenu()
|
||||
public function getDataMenu(Request $request)
|
||||
{
|
||||
// $data = Produk::with(['kategori_produk'])->get();
|
||||
$data = KelompokKategoriPivot::with(['kelompokKategori', 'produk'])->get();
|
||||
|
||||
$kelompok_kategori_id = $request->kelompok_produk;
|
||||
|
||||
if ($kelompok_kategori_id == null || $kelompok_kategori_id == 0) {
|
||||
$data = KelompokKategoriPivot::with(['kelompokKategori', 'produk'])->get();
|
||||
} else {
|
||||
$data = KelompokKategoriPivot::with(['kelompokKategori', 'produk'])
|
||||
->where('kelompok_kategori_id', $kelompok_kategori_id)
|
||||
->get();
|
||||
}
|
||||
|
||||
$nomor = 1;
|
||||
|
||||
return $datatables = datatables()
|
||||
|
@ -69,7 +80,8 @@ class Menu extends Controller
|
|||
}
|
||||
|
||||
// Tambah Menu
|
||||
public function store(Request $request) {
|
||||
public function store(Request $request)
|
||||
{
|
||||
// validation
|
||||
$rules = array(
|
||||
'kategori_produk' => 'required',
|
||||
|
@ -80,6 +92,11 @@ class Menu extends Controller
|
|||
'tersedia' => 'required',
|
||||
'deskripsi_produk' => 'required',
|
||||
);
|
||||
if ($request->kelompok_produk == 9) {
|
||||
$rules = array(
|
||||
'promodatetime' => 'required',
|
||||
);
|
||||
}
|
||||
$validator = Validator::make($request->all(), $rules);
|
||||
|
||||
// check validation
|
||||
|
@ -87,6 +104,22 @@ class Menu extends Controller
|
|||
// If validation fails, return with errors
|
||||
return response()->json(['errors' => $validator->errors()], 422);
|
||||
} else {
|
||||
|
||||
if ($request->kelompok_produk == 9) {
|
||||
// date promo 02/27/2024 12:00 AM - 03/30/2024 11:00 PM
|
||||
$tanggal_array = explode(" - ", $request->promodatetime);
|
||||
$tanggal_awal_string = $tanggal_array[0];
|
||||
$tanggal_akhir_string = $tanggal_array[1];
|
||||
|
||||
// Konversi string tanggal menjadi objek Carbon
|
||||
$tanggal_awal = Carbon::createFromFormat('m/d/Y h:i A', $tanggal_awal_string);
|
||||
$tanggal_akhir = Carbon::createFromFormat('m/d/Y h:i A', $tanggal_akhir_string);
|
||||
|
||||
// Mendapatkan tanggal dan waktu awal serta akhir
|
||||
$tgl_start_promo = $tanggal_awal->toDateTimeString();
|
||||
$tgl_end_promo = $tanggal_akhir->toDateTimeString();
|
||||
}
|
||||
|
||||
// create product
|
||||
$produk = Produk::create([
|
||||
'kategori_produk_id' => $request->kategori_produk,
|
||||
|
@ -95,6 +128,9 @@ class Menu extends Controller
|
|||
'harga_produk' => $request->harga_produk,
|
||||
'tersedia' => $request->tersedia,
|
||||
'deskripsi_produk' => $request->deskripsi_produk,
|
||||
'stok_promo' => $request->stok_promo,
|
||||
'tgl_start_promo' => $tgl_start_promo,
|
||||
'tgl_end_promo' => $tgl_end_promo,
|
||||
'created_at' => Carbon::now()
|
||||
]);
|
||||
|
||||
|
@ -107,15 +143,17 @@ class Menu extends Controller
|
|||
// Return a success response
|
||||
return response()->json(['message' => 'Data created successfully']);
|
||||
}
|
||||
}
|
||||
|
||||
public function show($id) {
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = KelompokKategoriPivot::with(['kelompokKategori', 'produk'])->findOrFail($id);
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
// Ubah Menu
|
||||
public function update(Request $request, $id) {
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// validation
|
||||
$rules = array(
|
||||
'kategori_produk' => 'required',
|
||||
|
@ -126,6 +164,11 @@ class Menu extends Controller
|
|||
'tersedia' => 'required',
|
||||
'deskripsi_produk' => 'required',
|
||||
);
|
||||
if ($request->kelompok_produk == 9) {
|
||||
$rules = array(
|
||||
'promodatetime' => 'required',
|
||||
);
|
||||
}
|
||||
$validator = Validator::make($request->all(), $rules);
|
||||
|
||||
// check validation
|
||||
|
@ -133,9 +176,25 @@ class Menu extends Controller
|
|||
// If validation fails, return with errors
|
||||
return response()->json(['errors' => $validator->errors()], 422);
|
||||
} else {
|
||||
|
||||
if ($request->kelompok_produk == 9) {
|
||||
// date promo 02/27/2024 12:00 AM - 03/30/2024 11:00 PM
|
||||
$tanggal_array = explode(" - ", $request->promodatetime);
|
||||
$tanggal_awal_string = $tanggal_array[0];
|
||||
$tanggal_akhir_string = $tanggal_array[1];
|
||||
|
||||
// Konversi string tanggal menjadi objek Carbon
|
||||
$tanggal_awal = Carbon::createFromFormat('m/d/Y h:i A', $tanggal_awal_string);
|
||||
$tanggal_akhir = Carbon::createFromFormat('m/d/Y h:i A', $tanggal_akhir_string);
|
||||
|
||||
// Mendapatkan tanggal dan waktu awal serta akhir
|
||||
$tgl_start_promo = $tanggal_awal->toDateTimeString();
|
||||
$tgl_end_promo = $tanggal_akhir->toDateTimeString();
|
||||
}
|
||||
|
||||
$pivot = KelompokKategoriPivot::findOrFail($id);
|
||||
$produk = Produk::find($pivot->produk_id);
|
||||
|
||||
|
||||
// update pivot produk
|
||||
$pivot->update([
|
||||
'kelompok_ketegori_id' => $request->kelompok_produk,
|
||||
|
@ -149,10 +208,13 @@ class Menu extends Controller
|
|||
'harga_produk' => $request->harga_produk,
|
||||
'tersedia' => $request->tersedia,
|
||||
'deskripsi_produk' => $request->deskripsi_produk,
|
||||
'stok_promo' => $request->stok_promo,
|
||||
'tgl_start_promo' => $tgl_start_promo,
|
||||
'tgl_end_promo' => $tgl_end_promo,
|
||||
]);
|
||||
|
||||
// Return a success response
|
||||
return response()->json(['message' => 'Data created successfully']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\Blameable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class PerangkatPrinter extends Model
|
||||
{
|
||||
use HasFactory, Blameable, SoftDeletes;
|
||||
|
||||
protected $table = 'perangkat_printers';
|
||||
protected $fillable = ['nama_printer', 'ip_address', 'printer_connection', 'printer_mm', 'printer_for', 'status'];
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('perangkat_printers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("nama_printer")->nullable();
|
||||
$table->enum("printer_mm", ["80", "58"])->default("80")->comment("0=80, 1=58");
|
||||
$table->enum("printer_connection", ["wireless", "wired"])->default("wired")->comment("0=wireless, 1=wired/usb");
|
||||
$table->string("ip_address")->nullable();
|
||||
$table->enum("printer_for", ["kasir", "dapur"])->default("kasir")->comment("0=kasir, 1=dapur");
|
||||
$table->enum("status", [1, 0])->default(0)->comment("0=nonaktif, 1=aktif");
|
||||
|
||||
$table->unsignedBigInteger("updated_by")->nullable();
|
||||
$table->unsignedBigInteger("created_by")->nullable();
|
||||
$table->unsignedBigInteger("deleted_by")->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('perangkat_printers');
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue