Compare commits
5
Commits
laravel-12
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d98878c657 | ||
|
|
71507f9818 | ||
|
|
ecd80cef9d | ||
|
|
d1a45ea3b3 | ||
|
|
f3acd28788 |
+3
-2
@@ -2,6 +2,7 @@ APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_TIMEZONE=UTC
|
||||
APP_URL=http://localhost
|
||||
|
||||
APP_LOCALE=en
|
||||
@@ -23,7 +24,7 @@ LOG_LEVEL=debug
|
||||
DB_CONNECTION=sqlite
|
||||
# DB_HOST=127.0.0.1
|
||||
# DB_PORT=3306
|
||||
# DB_DATABASE=filamentlaravel
|
||||
# DB_DATABASE=laravel
|
||||
# DB_USERNAME=root
|
||||
# DB_PASSWORD=
|
||||
|
||||
@@ -38,7 +39,7 @@ FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=database
|
||||
|
||||
CACHE_STORE=database
|
||||
# CACHE_PREFIX=
|
||||
CACHE_PREFIX=
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
|
||||
+2193
File diff suppressed because it is too large
Load Diff
@@ -1,172 +1,66 @@
|
||||
# FilamentLaravel
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
A Laravel 12 application scaffolded with Jetstream and Livewire, built with Vite and Tailwind CSS. This repo includes common local‑dev conveniences (concurrent processes for PHP server, queue worker, logs, and Vite) and a modern testing setup using Pest.
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
If you’re new to this codebase, this README helps you get it running locally and understand where things live.
|
||||
## About Laravel
|
||||
|
||||
> Note: The project name in `.env` is `APP_NAME=FilamentApp`. The repository name is `FilamentLaravel`.
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
## Stack
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
- Language: PHP ^8.2
|
||||
- Framework: Laravel ^12.0
|
||||
- Jetstream ^5.3
|
||||
- Sanctum ^4.0
|
||||
- Livewire ^3.x and Livewire Flux ^2.x
|
||||
- Frontend tooling: Vite ^6, Tailwind CSS ^4, PostCSS
|
||||
- Package managers: Composer (PHP), npm (Node)
|
||||
- Testing: Pest ^3 (with PHPUnit under the hood)
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Requirements
|
||||
## Learning Laravel
|
||||
|
||||
- PHP 8.2+
|
||||
- Composer 2.x
|
||||
- Node.js 18+ and npm 9+
|
||||
- A database (MySQL/MariaDB). Defaults from `.env`:
|
||||
- `DB_HOST=127.0.0.1`, `DB_PORT=3306`, `DB_DATABASE=filamentlaravel`, `DB_USERNAME=root`, `DB_PASSWORD=ServBay.dev`
|
||||
- Optional services depending on features you use:
|
||||
- Redis (default client configured: `phpredis`)
|
||||
- Mail catcher or SMTP server (defaults to `MAIL_MAILER=log`)
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
## Quick start
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
1. Clone and install dependencies
|
||||
```bash
|
||||
git clone <your-fork-or-repo-url>
|
||||
cd FilamentLaravel
|
||||
composer install
|
||||
npm install
|
||||
```
|
||||
2. Configure environment
|
||||
```bash
|
||||
cp .env.example .env # if .env doesn’t exist
|
||||
php artisan key:generate
|
||||
```
|
||||
- Update `.env` database credentials as needed.
|
||||
- Ensure `SESSION_DRIVER=database` (already set) and run migrations (next step) to create the sessions table.
|
||||
3. Create database and run migrations
|
||||
```bash
|
||||
php artisan migrate
|
||||
```
|
||||
4. Run the app (all-in-one dev experience)
|
||||
```bash
|
||||
composer run dev
|
||||
```
|
||||
This starts:
|
||||
- `php artisan serve` (Laravel app)
|
||||
- `php artisan queue:listen --tries=1` (queue worker)
|
||||
- `php artisan pail --timeout=0` (pretty app logs)
|
||||
- `npm run dev` (Vite)
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
Or run them individually:
|
||||
```bash
|
||||
php artisan serve
|
||||
npm run dev
|
||||
```
|
||||
## Laravel Sponsors
|
||||
|
||||
5. Visit the app at the URL shown by `php artisan serve` (defaults to `http://127.0.0.1:8000`). You can also set `APP_URL` in `.env`.
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
## Scripts
|
||||
### Premium Partners
|
||||
|
||||
- Composer
|
||||
- `composer run dev` — concurrently run server, queue worker, logs, and Vite
|
||||
- npm
|
||||
- `npm run dev` — start Vite in dev mode
|
||||
- `npm run build` — build frontend assets for production
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[WebReinvent](https://webreinvent.com/)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Jump24](https://jump24.co.uk)**
|
||||
- **[Redberry](https://redberry.international/laravel/)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
- **[byte5](https://byte5.de)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
|
||||
## Environment variables
|
||||
## Contributing
|
||||
|
||||
See `.env` for all variables. Common ones:
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
- Application
|
||||
- `APP_NAME` (default: `FilamentApp`)
|
||||
- `APP_ENV` (`local`, `production`, ...)
|
||||
- `APP_DEBUG` (true/false)
|
||||
- `APP_URL` (default: `http://localhost`)
|
||||
- `APP_LOCALE`, `APP_FALLBACK_LOCALE`
|
||||
- Logging
|
||||
- `LOG_CHANNEL` (default: `stack`), `LOG_LEVEL`
|
||||
- Database (MySQL by default)
|
||||
- `DB_CONNECTION`, `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD`
|
||||
- Cache/Queue/Session
|
||||
- `CACHE_STORE=database`
|
||||
- `QUEUE_CONNECTION=database`
|
||||
- `SESSION_DRIVER=database`, `SESSION_LIFETIME`
|
||||
- Redis
|
||||
- `REDIS_CLIENT=phpredis`, `REDIS_HOST`, `REDIS_PORT`
|
||||
- Mail
|
||||
- `MAIL_MAILER=log`, `MAIL_HOST`, `MAIL_PORT`, `MAIL_USERNAME`, `MAIL_PASSWORD`, `MAIL_FROM_*`
|
||||
- AWS (only if you enable S3, etc.)
|
||||
- `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`, `AWS_BUCKET`
|
||||
- Vite
|
||||
- `VITE_APP_NAME` (default mirrors `APP_NAME`)
|
||||
## Code of Conduct
|
||||
|
||||
## Project structure (selected)
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
- `app/` — application code (models, controllers, policies, jobs, etc.)
|
||||
- `bootstrap/` — framework bootstrap files
|
||||
- `config/` — application configuration
|
||||
- `database/` — migrations, factories, seeders
|
||||
- `public/` — public web root (entry: `public/index.php`)
|
||||
- `resources/` — Blade views, CSS, JS
|
||||
- `resources/css/app.css` — Tailwind entry
|
||||
- `resources/js/app.js` — JS entry (referenced by Vite)
|
||||
- `resources/views/...` — Blade templates (includes Livewire components)
|
||||
- `routes/`
|
||||
- `web.php` — web routes
|
||||
- `api.php` — API routes
|
||||
- `tests/` — test suite (Pest)
|
||||
- `vite.config.js` — Vite configuration
|
||||
- `artisan` — Laravel CLI
|
||||
- `composer.json` / `package.json` — dependencies and scripts
|
||||
## Security Vulnerabilities
|
||||
|
||||
## Development notes
|
||||
|
||||
- Vite HMR refresh is enabled via `laravel-vite-plugin` with inputs `resources/css/app.css` and `resources/js/app.js`.
|
||||
- Sessions, cache, and queue default to database-backed stores. Ensure migrations are run.
|
||||
- Jetstream is installed. The chosen Jetstream stack (Livewire vs Inertia) isn’t explicitly declared here — Livewire is present. See `composer.json` and `resources/views` for details.
|
||||
|
||||
## Testing
|
||||
|
||||
Run the test suite:
|
||||
```bash
|
||||
php artisan test
|
||||
# or
|
||||
./vendor/bin/pest
|
||||
```
|
||||
|
||||
You can create tests under `tests/` using Pest’s syntax.
|
||||
|
||||
## Deployment
|
||||
|
||||
- Build frontend assets:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
- Ensure `APP_ENV=production`, `APP_DEBUG=false`, correct `APP_URL`, and proper cache/queue/mail configurations.
|
||||
- Run database migrations on deploy:
|
||||
```bash
|
||||
php artisan migrate --force
|
||||
```
|
||||
|
||||
### Docker (optional)
|
||||
Laravel Sail is included as a dev dependency. If you prefer Docker, you can set up Sail. This repository does not include a prepared Sail config in this README.
|
||||
|
||||
## Entry points
|
||||
|
||||
- HTTP: `public/index.php` (served via the web server or `php artisan serve`)
|
||||
- CLI: `artisan`
|
||||
- Frontend dev server: `npm run dev` (Vite)
|
||||
|
||||
## TODOs / Unknowns
|
||||
|
||||
- Production deployment target and steps (server, PaaS, container registry) — TODO
|
||||
- Domain and HTTPS/TLS configuration — TODO
|
||||
- Mail provider and credentials for non‑log mailers — TODO
|
||||
- Storage driver(s) for user uploads (local vs S3) — TODO
|
||||
- Background jobs in production (e.g., Supervisor, Horizon) — TODO
|
||||
- Any seeded demo data or default admin user — TODO
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
This project is open-sourced software licensed under the MIT license. See `composer.json` for the declared license.
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as BuildplateModel;
|
||||
use App\Models\Manufacturer as Manufacturer;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class Buildplate extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public $search ='';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('buildplate.create', navigate: true);
|
||||
}
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('buildplate.edit', $id, navigate: true);
|
||||
}
|
||||
public function show($id){
|
||||
return $this->redirectRoute('buildplate.show', $id, navigate: true);
|
||||
}
|
||||
public function delete($id){
|
||||
BuildplateModel::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.index', [
|
||||
'buildplates' => BuildplateModel::search('name', $this->search)->paginate(10),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class CreateBuildplate extends Component
|
||||
{
|
||||
public Model $buildplate ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public string $temp_max = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$buildplate = new Model();
|
||||
$buildplate->name = $this->name;
|
||||
$buildplate->description = $this->description;
|
||||
$buildplate->manufacturer_id = $this->manufacturer_id;
|
||||
$buildplate->temp_max = $this->temp_max;
|
||||
$buildplate->save();
|
||||
|
||||
return $this->redirectRoute('buildplate.show', $buildplate->id , navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class EditBuildplate extends Component
|
||||
{
|
||||
public Model $buildplate ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public string $temp_max = '';
|
||||
|
||||
public function mount(Model $buildplate){
|
||||
$this->buildplate = $buildplate;
|
||||
$this->name = $buildplate->name;
|
||||
$this->description = $buildplate->description;
|
||||
$this->manufacturer_id = $buildplate->manufacturer_id;
|
||||
$this->temp_max = $buildplate->temp_max;
|
||||
}
|
||||
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$this->buildplate->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'manufacturer_id' => $this->manufacturer_id,
|
||||
'temp_max' => $this->temp_max
|
||||
]);
|
||||
return $this->redirectRoute('livewire.buildplate.show', $this->buildplate->id, navigate: true);
|
||||
}
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('buildplate.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.edit', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Buildplate;
|
||||
|
||||
use App\Models\Buildplate as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Buildplates')]
|
||||
class ShowBuildplate extends Component
|
||||
{
|
||||
public Model $buildplate ;
|
||||
|
||||
public function back(){
|
||||
return $this->redirectRoute('buildplate.index', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('buildplate.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.buildplate.show', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Calculationpreset;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
use App\Models\Calculationpreset as Model;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Calculationpreset')]
|
||||
class Calculationpreset extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public Model $calculationpreset ;
|
||||
|
||||
public $search = '';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('calculationpresets.create', navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('calculationpresets.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('calculationpresets.edit', $id);
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
@Auth::check();
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.calculationpreset.index', [
|
||||
'calculationpresets' => Model::search('name', $this->search)->paginate(25)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Calculationpreset;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Calculationpreset as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Create Calculationpreset')]
|
||||
class CreateCalculationpreset extends Component
|
||||
{
|
||||
public Model $calculationpreset ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public float $price_kwh = 0;
|
||||
public float $factor_printer = 0;
|
||||
public float $factor_maintenance = 0;
|
||||
public float $factor_price = 0;
|
||||
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'price_kwh' => ['required', 'numeric'],
|
||||
'factor_printer' => ['nullable', 'numeric'],
|
||||
'factor_maintenance' => ['nullable', 'numeric'],
|
||||
'factor_price' => ['nullable', 'numeric']
|
||||
]);
|
||||
|
||||
$calculationpreset = new Model();
|
||||
$calculationpreset->name = $this->name;
|
||||
$calculationpreset->description = $this->description;
|
||||
$calculationpreset->price_kwh = $this->price_kwh;
|
||||
$calculationpreset->factor_printer = $this->factor_printer;
|
||||
$calculationpreset->factor_maintenance = $this->factor_maintenance;
|
||||
$calculationpreset->factor_price = $this->factor_price;
|
||||
$calculationpreset->save();
|
||||
|
||||
return $this->redirectRoute('calculationpresets.show', $calculationpreset->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('calculationpresets.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.calculationpreset.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Calculationpreset;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Calculationpreset as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Edit Calculationpreset')]
|
||||
class EditCalculationpreset extends Component
|
||||
{
|
||||
public Model $calculationpreset ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public float $price_kwh = 0;
|
||||
public float $factor_printer = 0;
|
||||
public float $factor_maintenance = 0;
|
||||
public float $factor_price = 0;
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'price_kwh' => ['required', 'numeric'],
|
||||
'factor_printer' => ['nullable', 'numeric'],
|
||||
'factor_maintenance' => ['nullable', 'numeric'],
|
||||
'factor_price' => ['nullable', 'numeric']
|
||||
]);
|
||||
|
||||
$this->calculationpreset->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'price_kwh' => $this->price_kwh,
|
||||
'factor_printer' => $this->factor_printer,
|
||||
'factor_maintenance' => $this->factor_maintenance,
|
||||
'factor_price' => $this->factor_price
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('calculationpresets.show', $this->calculationpreset->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('calculationpresets.index', navigate: true);
|
||||
}
|
||||
|
||||
public function mount(Model $calculationpreset){
|
||||
$this->calculationpreset = $calculationpreset;
|
||||
$this->name = $calculationpreset->name;
|
||||
$this->description = $calculationpreset->description;
|
||||
$this->price_kwh = $calculationpreset->price_kwh;
|
||||
$this->factor_printer = $calculationpreset->factor_printer;
|
||||
$this->factor_maintenance = $calculationpreset->factor_maintenance;
|
||||
$this->factor_price = $calculationpreset->factor_price;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.calculationpreset.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Calculationpreset;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Calculationpreset as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Show Calculationpreset')]
|
||||
class ShowCalculationpreset extends Component
|
||||
{
|
||||
|
||||
public Model $calculationpreset ;
|
||||
|
||||
public function back(){
|
||||
return redirect()->route('calculationpresets.index');
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return redirect()->route('calculationpresets.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.calculationpreset.show', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Calculator;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
use App\Models\Calculationpreset as Model;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
use App\Models\Filament;
|
||||
use App\Models\FilamentType;
|
||||
use App\Models\Manufacturer;
|
||||
use App\Models\Color;
|
||||
|
||||
#[title('Calculator')]
|
||||
class Calculator extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public string $selection = '1';
|
||||
public float $time = 0;
|
||||
public string $timeunit = 'h';
|
||||
public float $additionalcost = 0;
|
||||
public string $additionalcostunit = 'per Piece';
|
||||
public int $countonplate = 0;
|
||||
public int $selcountonplate = 0;
|
||||
public string $search_type = '';
|
||||
public string $search_manufacturer = '';
|
||||
public string $search_name = '';
|
||||
public string $search_color = '';
|
||||
|
||||
public array $selectedFilaments = []; // [filament_id => amount_g]
|
||||
|
||||
public function toggleFilament($filamentId)
|
||||
{
|
||||
if (isset($this->selectedFilaments[$filamentId])) {
|
||||
unset($this->selectedFilaments[$filamentId]);
|
||||
} else {
|
||||
$this->selectedFilaments[$filamentId] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
$filaments = Filament::query()
|
||||
->where(function ($query) {
|
||||
$query->when($this->search_type, function ($query) {
|
||||
$query->whereHas('type', function ($q) {
|
||||
$q->where('name', $this->search_type);
|
||||
});
|
||||
})
|
||||
->when($this->search_manufacturer, function ($query) {
|
||||
$query->whereHas('manufacturer', function ($q) {
|
||||
$q->where('name', 'like', '%' . $this->search_manufacturer . '%');
|
||||
});
|
||||
})
|
||||
->when($this->search_name, function ($query) {
|
||||
$query->where('name', 'like', '%' . $this->search_name . '%');
|
||||
})
|
||||
->when($this->search_color, function ($query) {
|
||||
$query->whereHas('color', function ($q) {
|
||||
$q->where('name', 'like', '%' . $this->search_color . '%');
|
||||
});
|
||||
});
|
||||
})
|
||||
->orWhereIn('id', array_keys($this->selectedFilaments))
|
||||
->with(['type', 'manufacturer', 'color'])
|
||||
->get();
|
||||
|
||||
return view('livewire.calculator', [
|
||||
'presets' => \App\Models\Calculationpreset::all(),
|
||||
'calculationpreset' => \App\Models\Calculationpreset::find($this->selection),
|
||||
'filaments' => $filaments,
|
||||
'filamenttypes' => FilamentType::all(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Color;
|
||||
|
||||
use App\Models\Color as ColorModel;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Colors')]
|
||||
class Color extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public $search ='';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('color.create', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('color.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('color.show', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
ColorModel::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.color.index', [
|
||||
'colors' => ColorModel::search('name', $this->search)->paginate(10)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Color;
|
||||
|
||||
use App\Models\Color as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Colors')]
|
||||
class CreateColor extends Component
|
||||
{
|
||||
|
||||
public Model $color ;
|
||||
|
||||
public string $name = '';
|
||||
public string $hex = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'hex' => ['required', 'string', 'size:6', 'regex:/^[0-9A-F]{6}$/'],
|
||||
]);
|
||||
|
||||
$color = new Model();
|
||||
$color->name = $this->name;
|
||||
$color->hex = $this->hex;
|
||||
$color->save();
|
||||
|
||||
return $this->redirectRoute('color.show', $color->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('color.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.color.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Color;
|
||||
|
||||
use App\Models\Color as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Colors')]
|
||||
class EditColor extends Component
|
||||
{
|
||||
public Model $color;
|
||||
|
||||
public string $name = '';
|
||||
public string $hex = '';
|
||||
|
||||
public function mount(Model $color){
|
||||
$this->color = $color;
|
||||
$this->name = $color->name;
|
||||
$this->hex = $color->hex;
|
||||
}
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'hex' => ['required', 'string', 'size:6', 'regex:/^[0-9A-F]{6}$/'],
|
||||
]);
|
||||
|
||||
$this->color->update([
|
||||
'name' => $this->name,
|
||||
'hex' => $this->hex,
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('color.show', $this->color->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('color.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.color.edit', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Color;
|
||||
|
||||
use App\Models\Color as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Colors')]
|
||||
class ShowColor extends Component
|
||||
{
|
||||
public Model $color;
|
||||
|
||||
public function mount(Model $color){
|
||||
$this->color = $color;
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('color.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function back(){
|
||||
return $this->redirectRoute('color.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.color.show', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Manufacturer;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Dashboard')]
|
||||
class Dashboard extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.dashboard', [
|
||||
'manufacturers' => Manufacturer::all()->sortBy('filament_count')->reverse()
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Extruder;
|
||||
|
||||
use App\Models\Extruder as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Extruders')]
|
||||
class CreateExtruder extends Component
|
||||
{
|
||||
public Model $extruder ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public string $diameter = '';
|
||||
public string $temp_max = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'diameter' => ['required', 'string', 'max:4'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$extruder = new Model();
|
||||
$extruder->name = $this->name;
|
||||
$extruder->description = $this->description;
|
||||
$extruder->manufacturer_id = $this->manufacturer_id;
|
||||
$extruder->diameter = $this->diameter;
|
||||
$extruder->temp_max = $this->temp_max;
|
||||
$extruder->save();
|
||||
|
||||
return $this->redirectRoute('extruder.show', $extruder->id , navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('extruder.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.extruder.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Extruder;
|
||||
|
||||
use App\Models\Extruder as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Extruders')]
|
||||
class EditExtruder extends Component
|
||||
{
|
||||
public Model $extruder ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public string $diameter = '';
|
||||
public string $temp_max = '';
|
||||
|
||||
public function mount(Model $extruder){
|
||||
$this->extruder = $extruder;
|
||||
$this->name = $extruder->name;
|
||||
$this->description = $extruder->description;
|
||||
$this->manufacturer_id = $extruder->manufacturer_id;
|
||||
$this->diameter = $extruder->diameter;
|
||||
$this->temp_max = $extruder->temp_max;
|
||||
}
|
||||
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'diameter' => ['required', 'string', 'max:4'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$this->extruder->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'manufacturer_id' => $this->manufacturer_id,
|
||||
'diameter' => $this->diameter,
|
||||
'temp_max' => $this->temp_max
|
||||
]);
|
||||
return $this->redirectRoute('extruder.show', $this->extruder->id, navigate: true);
|
||||
}
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('extruder.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.extruder.edit', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Extruder;
|
||||
|
||||
use App\Models\Extruder as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Extruders')]
|
||||
class Extruder extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public $search ='';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('extruder.create', navigate: true);
|
||||
}
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('extruder.edit', $id, navigate: true);
|
||||
}
|
||||
public function show($id){
|
||||
return $this->redirectRoute('extruder.show', $id, navigate: true);
|
||||
}
|
||||
public function delete($id){
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.extruder.index', [
|
||||
'extruders' => Model::search('name', $this->search)->paginate(10),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Extruder;
|
||||
|
||||
use App\Models\Extruder as Model;
|
||||
use Livewire\Attributes\Title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Extruders')]
|
||||
class ShowExtruder extends Component
|
||||
{
|
||||
public Model $extruder ;
|
||||
|
||||
public function back(){
|
||||
return $this->redirectRoute('extruder.index', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('extruder.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.extruder.show', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Filament;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Filament as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Create Filament')]
|
||||
class CreateFilament extends Component
|
||||
{
|
||||
public Model $filament ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $color_id = 0;
|
||||
public int $manufacturer_id = 0;
|
||||
public int $filament_type_id = 0;
|
||||
public int $weight = 1000;
|
||||
public string $diameter = '1.75';
|
||||
public float $price = 0;
|
||||
public int $temp_min = 0;
|
||||
public int $temp_max = 0;
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'color_id' => ['required', 'integer'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'filament_type_id' => ['required', 'integer'],
|
||||
'weight' => ['required', 'integer'],
|
||||
'diameter' => ['required', 'string', 'max:4'],
|
||||
'price' => ['required', 'numeric'],
|
||||
'temp_min' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$filament = new Model();
|
||||
$filament->name = $this->name;
|
||||
$filament->description = $this->description;
|
||||
$filament->color_id = $this->color_id;
|
||||
$filament->manufacturer_id = $this->manufacturer_id;
|
||||
$filament->filament_type_id = $this->filament_type_id;
|
||||
$filament->weight = $this->weight;
|
||||
$filament->diameter = $this->diameter;
|
||||
$filament->price = $this->price;
|
||||
$filament->temp_min = $this->temp_min;
|
||||
$filament->temp_max = $this->temp_max;
|
||||
$filament->save();
|
||||
|
||||
return $this->redirectRoute('filaments.show', $filament->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('filaments.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.filament.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Filament;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Filament as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Create Filament')]
|
||||
class EditFilament extends Component
|
||||
{
|
||||
public Model $filament ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $color_id = 0;
|
||||
public int $manufacturer_id = 0;
|
||||
public int $filament_type_id = 0;
|
||||
public int $weight = 1000;
|
||||
public string $diameter = '1.75';
|
||||
public float $price = 0;
|
||||
public int $temp_min = 0;
|
||||
public int $temp_max = 0;
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'color_id' => ['required', 'integer'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'filament_type_id' => ['required', 'integer'],
|
||||
'weight' => ['required', 'integer'],
|
||||
'diameter' => ['required', 'string', 'max:4'],
|
||||
'price' => ['required', 'numeric'],
|
||||
'temp_min' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer']
|
||||
]);
|
||||
|
||||
$this->filament->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'color_id' => $this->color_id,
|
||||
'manufacturer_id' => $this->manufacturer_id,
|
||||
'filament_type_id' => $this->filament_type_id,
|
||||
'weight' => $this->weight,
|
||||
'diameter' => $this->diameter,
|
||||
'price' => $this->price,
|
||||
'temp_min' => $this->temp_min,
|
||||
'temp_max' => $this->temp_max
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('filaments.show', $this->filament->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('filaments.index', navigate: true);
|
||||
}
|
||||
|
||||
public function mount(Model $filament){
|
||||
$this->filament = $filament;
|
||||
$this->name = $filament->name;
|
||||
$this->description = $filament->description;
|
||||
$this->color_id = $filament->color_id;
|
||||
$this->manufacturer_id = $filament->manufacturer_id;
|
||||
$this->filament_type_id = $filament->filament_type_id;
|
||||
$this->weight = $filament->weight;
|
||||
$this->diameter = $filament->diameter;
|
||||
$this->price = $filament->price;
|
||||
$this->temp_min = $filament->temp_min;
|
||||
$this->temp_max = $filament->temp_max;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.filament.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Filament;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Filament as Model;
|
||||
use App\Models\Color as Color;
|
||||
use App\Models\FilamentType as Type;
|
||||
use App\Models\Manufacturer as Manufacturer;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
#[title('Filaments')]
|
||||
class Filament extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public Model $filament ;
|
||||
|
||||
public $search = '';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('filaments.create', navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('filaments.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('filaments.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.filament.index', [
|
||||
'filaments' => Model::search('name', $this->search)->paginate(25)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Filament;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Filament as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Show Filament')]
|
||||
class ShowFilament extends Component
|
||||
{
|
||||
|
||||
public Model $filament ;
|
||||
|
||||
public function back(){
|
||||
return redirect()->route('filaments.index');
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return redirect()->route('filaments.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.filament.show', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class CreateManufacturer extends Component{
|
||||
|
||||
public Model $manufacturer ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public string $website = '';
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'website' => ['nullable', 'string', 'max:255']
|
||||
]);
|
||||
|
||||
$manufacturer = new Model();
|
||||
$manufacturer->name = $this->name;
|
||||
$manufacturer->description = $this->description;
|
||||
$manufacturer->website = $this->website;
|
||||
$manufacturer->save();
|
||||
|
||||
return redirect()->route('manufacturer.index');
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class EditManufacturer extends Component{
|
||||
|
||||
public Model $manufacturer ;
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public string $website = '';
|
||||
|
||||
public function mount(Model $manufacturer){
|
||||
$this->manufacturer = $manufacturer;
|
||||
$this->name = $manufacturer->name;
|
||||
$this->description = $manufacturer->description;
|
||||
$this->website = $manufacturer->website;
|
||||
}
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'website' => ['nullable', 'string', 'max:255']
|
||||
]);
|
||||
|
||||
$this->manufacturer->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'website' => $this->website
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('manufacturer.show', $this->manufacturer->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('manufacturer.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.edit', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class Manufacturer extends Component{
|
||||
use WithPagination;
|
||||
|
||||
public $search ='';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('manufacturer.create', navigate: true);
|
||||
}
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('manufacturer.edit', $id, navigate: true);
|
||||
}
|
||||
public function show($id){
|
||||
return $this->redirectRoute('manufacturer.show', $id, navigate: true);
|
||||
}
|
||||
public function delete($id){
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.index', [
|
||||
'manufacturers' => Model::search('name', $this->search)->paginate(10)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Manufacturer;
|
||||
|
||||
use App\Models\Manufacturer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Manufacturer List')]
|
||||
class ShowManufacturer extends Component{
|
||||
|
||||
public Model $manufacturer ;
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('manufacturer.edit', $id, navigate: true);
|
||||
}
|
||||
public function back(){
|
||||
return $this->redirectRoute('manufacturer.index', navigate: true);
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
|
||||
return view('livewire.manufacturer.show', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Orders;
|
||||
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderStatus;
|
||||
|
||||
#[title('Orders')]
|
||||
class Orders extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public $search = '';
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.orders.orders',[
|
||||
'orders' => Order::latest()->paginate(10),
|
||||
'order_statuses' => OrderStatus::all()
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printer;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Printer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Create Printertype')]
|
||||
class CreatePrinter extends Component
|
||||
{
|
||||
public Model $printer ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $printertype_id = 0;
|
||||
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'printertype_id' => ['required', 'integer'],
|
||||
]);
|
||||
|
||||
$printer = new Model();
|
||||
$printer->name = $this->name;
|
||||
$printer->description = $this->description;
|
||||
$printer->printertype_id = $this->printertype_id;
|
||||
$printer->save();
|
||||
|
||||
return $this->redirectRoute('printers.show', $printer->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('printers.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printer.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printer;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Printer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Edit Printer')]
|
||||
class EditPrinter extends Component
|
||||
{
|
||||
public Model $printer ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $printertype_id = 0;
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'printertype_id' => ['required', 'integer'],
|
||||
]);
|
||||
|
||||
$this->printertype->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'printertype_id' => $this->printertype_id,
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('printers.show', $this->printer->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('printers.index', navigate: true);
|
||||
}
|
||||
|
||||
public function mount(Model $printer){
|
||||
$this->printer = $printer;
|
||||
$this->name = $printer->name;
|
||||
$this->description = $printer->description;
|
||||
$this->printertype_id = $printer->printertype_id;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printer.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printer;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
use App\Models\Printer as Model;
|
||||
use App\Models\Manufacturer as Manufacturer;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Printer')]
|
||||
class Printer extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public Model $printer ;
|
||||
|
||||
public $search = '';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('printers.create', navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('printers.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('printers.edit', $id);
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
@Auth::check();
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printer.index', [
|
||||
'printers' => Model::search('name', $this->search)->paginate(25)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printer;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Printer as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Show Printer')]
|
||||
class ShowPrinter extends Component
|
||||
{
|
||||
|
||||
public Model $printer ;
|
||||
|
||||
public function back(){
|
||||
return redirect()->route('printers.index');
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return redirect()->route('printers.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printer.show', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printertype;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Printertype as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Create Printertype')]
|
||||
class CreatePrintertype extends Component
|
||||
{
|
||||
public Model $printertype ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public int $temp_max = 0;
|
||||
public int $bed_size_x = 0;
|
||||
public int $bed_size_y = 0;
|
||||
public float $price = 0;
|
||||
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer'],
|
||||
'bed_size_x' => ['nullable', 'numeric'],
|
||||
'bed_size_y' => ['nullable', 'numeric'],
|
||||
'price' => ['nullable', 'numeric']
|
||||
]);
|
||||
|
||||
$printertype = new Model();
|
||||
$printertype->name = $this->name;
|
||||
$printertype->description = $this->description;
|
||||
$printertype->manufacturer_id = $this->manufacturer_id;
|
||||
$printertype->temp_max = $this->temp_max;
|
||||
$printertype->bed_size_x = $this->bed_size_x;
|
||||
$printertype->bed_size_y = $this->bed_size_y;
|
||||
$printertype->price = $this->price;
|
||||
$printertype->save();
|
||||
|
||||
return $this->redirectRoute('printertypes.show', $printertype->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('printertypes.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printertype.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printertype;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Printertype as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Edit Printertype')]
|
||||
class EditPrintertype extends Component
|
||||
{
|
||||
public Model $printertype ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
public int $temp_max = 0;
|
||||
public int $bed_size_x = 0;
|
||||
public int $bed_size_y = 0;
|
||||
public float $price = 0;
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
'temp_max' => ['required', 'integer'],
|
||||
'bed_size_x' => ['nullable', 'numeric'],
|
||||
'bed_size_y' => ['nullable', 'numeric'],
|
||||
'price' => ['nullable', 'numeric']
|
||||
]);
|
||||
|
||||
$this->printertype->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'manufacturer_id' => $this->manufacturer_id,
|
||||
'temp_max' => $this->temp_max,
|
||||
'bed_size_x' => $this->bed_size_x,
|
||||
'bed_size_y' => $this->bed_size_y,
|
||||
'price' => $this->price
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('printertypes.show', $this->printertype->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('printertypes.index', navigate: true);
|
||||
}
|
||||
|
||||
public function mount(Model $printertype){
|
||||
$this->printertype = $printertype;
|
||||
$this->name = $printertype->name;
|
||||
$this->description = $printertype->description;
|
||||
$this->manufacturer_id = $printertype->manufacturer_id;
|
||||
$this->temp_max = $printertype->temp_max;
|
||||
$this->bed_size_x = $printertype->bed_size_x;
|
||||
$this->bed_size_y = $printertype->bed_size_y;
|
||||
$this->price = $printertype->price;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printertype.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printertype;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
use App\Models\Printertype as Model;
|
||||
use App\Models\Manufacturer as Manufacturer;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Printertypes')]
|
||||
class Printertype extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public Model $printertype ;
|
||||
|
||||
public $search = '';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('printertypes.create', navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('printertypes.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('printertypes.edit', $id);
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
@Auth::check();
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printertype.index', [
|
||||
'printertypes' => Model::search('name', $this->search)->paginate(25)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Printertype;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Printertype as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Show Printertype')]
|
||||
class ShowPrintertype extends Component
|
||||
{
|
||||
|
||||
public Model $printertype ;
|
||||
|
||||
public function back(){
|
||||
return redirect()->route('printertypes.index');
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return redirect()->route('printertypes.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.printertype.show', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Settings;
|
||||
|
||||
use Livewire\Component;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Settings')]
|
||||
class Settings extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.settings.settings');
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Sparepart;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Sparepart as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Create Sparepart')]
|
||||
class CreateSparepart extends Component
|
||||
{
|
||||
public Model $sparepart ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
]);
|
||||
|
||||
$sparepart = new Model();
|
||||
$sparepart->name = $this->name;
|
||||
$sparepart->description = $this->description;
|
||||
$sparepart->manufacturer_id = $this->manufacturer_id;
|
||||
$sparepart->save();
|
||||
|
||||
return $this->redirectRoute('spareparts.show', $sparepart->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('spareparts.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.sparepart.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Sparepart;
|
||||
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use App\Models\Sparepart as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Edit Sparepart')]
|
||||
class EditSparepart extends Component
|
||||
{
|
||||
public Model $sparepart ;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
public int $manufacturer_id = 0;
|
||||
|
||||
#[Validate('required')]
|
||||
public function save(){
|
||||
$this->validate([
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'description' => ['nullable', 'string', 'max:255'],
|
||||
'manufacturer_id' => ['required', 'integer'],
|
||||
]);
|
||||
|
||||
$this->sparepart->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'manufacturer_id' => $this->manufacturer_id
|
||||
]);
|
||||
|
||||
return $this->redirectRoute('spareparts.show', $this->sparepart->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('spareparts.index', navigate: true);
|
||||
}
|
||||
|
||||
public function mount(Model $sparepart){
|
||||
$this->sparepart = $sparepart;
|
||||
$this->name = $sparepart->name;
|
||||
$this->description = $sparepart->description;
|
||||
$this->manufacturer_id = $sparepart->manufacturer_id;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.sparepart.create', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Sparepart;
|
||||
|
||||
use Livewire\Component;
|
||||
use App\Models\Sparepart as Model;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Show Sparepart')]
|
||||
class ShowSparepart extends Component
|
||||
{
|
||||
|
||||
public Model $sparepart ;
|
||||
|
||||
public function back(){
|
||||
return redirect()->route('spareparts.index');
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return redirect()->route('spareparts.edit', $id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.sparepart.show', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Sparepart;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Component;
|
||||
use App\Models\Sparepart as Model;
|
||||
use App\Models\Manufacturer as Manufacturer;
|
||||
use Livewire\WithPagination;
|
||||
use Livewire\Attributes\title;
|
||||
|
||||
#[title('Spareparts')]
|
||||
class Sparepart extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public Model $sparepart ;
|
||||
|
||||
public $search = '';
|
||||
|
||||
public function create(){
|
||||
return $this->redirectRoute('spareparts.create', navigate: true);
|
||||
}
|
||||
|
||||
public function show($id){
|
||||
return $this->redirectRoute('spareparts.show', $id);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('spareparts.edit', $id);
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
@Auth::check();
|
||||
Model::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.sparepart.index', [
|
||||
'spareparts' => Model::search('name', $this->search)->paginate(25)
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Type;
|
||||
|
||||
use App\Models\FilamentType;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Types')]
|
||||
class CreateType extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
// Validation
|
||||
#[Validate('required')]
|
||||
public $name = '';
|
||||
public $description = '';
|
||||
|
||||
public $search ='';
|
||||
|
||||
public function save() {
|
||||
@Auth::check();
|
||||
|
||||
|
||||
// Validate
|
||||
$this->validate();
|
||||
|
||||
$type = new FilamentType();
|
||||
$type->name = $this->name;
|
||||
$type->description = $this->description;
|
||||
$type->save();
|
||||
|
||||
return $this->redirectRoute('type.show', $type->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel(){
|
||||
return $this->redirectRoute('type.index', navigate: true);
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.type.create', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Type;
|
||||
|
||||
use App\Models\FilamentType as Model;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
|
||||
#[title('Types')]
|
||||
class EditType extends Component
|
||||
{
|
||||
public Model $type;
|
||||
|
||||
public string $name = '';
|
||||
public string $description = '';
|
||||
|
||||
public function mount(Model $type)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->name = $type->name;
|
||||
$this->description = $type->description;
|
||||
}
|
||||
|
||||
// Validation
|
||||
#[Validate('required')]
|
||||
public function save()
|
||||
{
|
||||
$this->validate([
|
||||
'type.name' => ['required', 'string', 'max:255'],
|
||||
'type.description' => ['nullable', 'string'],
|
||||
]);
|
||||
|
||||
$this->type->update([
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
]);
|
||||
|
||||
|
||||
return $this->redirectRoute('type.show', $this->type->id, navigate: true);
|
||||
}
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
return $this->redirectRoute('type.index', navigate: true);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.type.edit', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Type;
|
||||
|
||||
use App\Models\FilamentType;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Types')]
|
||||
class ShowType extends Component
|
||||
{
|
||||
public FilamentType $type;
|
||||
|
||||
public function back(){
|
||||
return $this->redirectRoute('type.index', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($id){
|
||||
return $this->redirectRoute('type.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function mount(FilamentType $type){
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.type.show', [
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Type;
|
||||
|
||||
use App\Models\FilamentType;
|
||||
use Flux\Flux;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\title;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
#[title('Types')]
|
||||
class Type extends Component
|
||||
{
|
||||
use WithPagination;
|
||||
|
||||
public $search = '';
|
||||
|
||||
// Validation
|
||||
#[Validate('required')]
|
||||
|
||||
public function create()
|
||||
{
|
||||
return $this->redirectRoute('type.create', navigate: true);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
return $this->redirectRoute('type.edit', $id, navigate: true);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return $this->redirectRoute('type.show', $id, navigate: true);
|
||||
}
|
||||
public function delete($id){
|
||||
@Auth::check();
|
||||
FilamentType::destroy($id);
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.type.index', [
|
||||
'types' => FilamentType::search('name', $this->search)->paginate(10)
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Buildplate extends Model
|
||||
{
|
||||
// Buildplate Model
|
||||
protected $table = 'buildplates';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'manufacturer_id',
|
||||
'temp_max',
|
||||
'amount'
|
||||
];
|
||||
|
||||
public function filament()
|
||||
{
|
||||
return $this->hasMany(Filament::class);
|
||||
}
|
||||
|
||||
public function manufacturer()
|
||||
{
|
||||
return $this->belongsTo(Manufacturer::class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Calculationpreset extends Model
|
||||
{
|
||||
// Calculationpreset Model
|
||||
protected $table = 'calculatorpresets';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'price_kwh',
|
||||
'factor_printer',
|
||||
'factor_maintenance',
|
||||
'factor_price'
|
||||
];
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Color extends Model
|
||||
{
|
||||
// Color Model
|
||||
protected $table = 'colors';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'hex'
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Extruder extends Model
|
||||
{
|
||||
// Extruder Model
|
||||
protected $table = 'extruders';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'manufacturer_id',
|
||||
'diameter',
|
||||
'temp_max'
|
||||
];
|
||||
|
||||
public function manufacturer()
|
||||
{
|
||||
return $this->belongsTo(Manufacturer::class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Filament extends Model
|
||||
{
|
||||
// Filament Model
|
||||
protected $table = 'filaments';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'filament_type_id',
|
||||
'manufacturer_id',
|
||||
'color_id',
|
||||
'weight',
|
||||
'diameter',
|
||||
'price',
|
||||
'finish',
|
||||
'image',
|
||||
'stock',
|
||||
'temp_min',
|
||||
'temp_max',
|
||||
'buildplate_id',
|
||||
'extruder_id'
|
||||
];
|
||||
|
||||
// Filament belongs to a type
|
||||
public function type()
|
||||
{
|
||||
return $this->belongsTo(FilamentType::class, 'filament_type_id');
|
||||
}
|
||||
|
||||
// Filament belongs to a manufacturer
|
||||
public function manufacturer()
|
||||
{
|
||||
return $this->belongsTo(Manufacturer::class);
|
||||
}
|
||||
|
||||
// Filament belongs to a color
|
||||
public function color()
|
||||
{
|
||||
return $this->belongsTo(Color::class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FilamentType extends Model
|
||||
{
|
||||
protected $table = 'filament_types';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
];
|
||||
|
||||
// FilamentType has many filaments
|
||||
public function filaments()
|
||||
{
|
||||
return $this->hasMany(Filament::class);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Manufacturer extends Model
|
||||
{
|
||||
// Manufacturer Model
|
||||
protected $table = 'manufacturers';
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'website',
|
||||
'logo',
|
||||
'filament_count'
|
||||
];
|
||||
|
||||
// Manufacturer has many filaments
|
||||
public function filaments()
|
||||
{
|
||||
return $this->hasMany(Filament::class);
|
||||
}
|
||||
|
||||
// Manufacturer has many filament type
|
||||
public function filamentTypes()
|
||||
{
|
||||
return $this->hasMany(FilamentType::class);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
// Order Model
|
||||
protected $table = 'orders';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'items',
|
||||
'total_price',
|
||||
'order_status_id'
|
||||
];
|
||||
|
||||
public function filament()
|
||||
{
|
||||
return $this->belongsTo(Filament::class);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrderStatus extends Model
|
||||
{
|
||||
// The table associated with the model.
|
||||
protected $table = 'order_statuses';
|
||||
|
||||
// The attributes that are mass assignable.
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Printer extends Model
|
||||
{
|
||||
// Printer Model
|
||||
protected $table = 'printers';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'printertype_id'
|
||||
];
|
||||
public function printertype()
|
||||
{
|
||||
return $this->belongsTo(Printertype::class);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Printertype extends Model
|
||||
{
|
||||
// Printertype Model
|
||||
protected $table = 'printertypes';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'bed_size_x',
|
||||
'bed_size_y',
|
||||
'temp_min',
|
||||
'temp_max',
|
||||
'price',
|
||||
];
|
||||
public function manufacturer()
|
||||
{
|
||||
return $this->belongsTo(Manufacturer::class);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Sparepart extends Model
|
||||
{
|
||||
// Sparepart Model
|
||||
protected $table = 'spareparts';
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
];
|
||||
public function manufacturer()
|
||||
{
|
||||
return $this->belongsTo(Manufacturer::class);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -20,10 +19,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// Search
|
||||
Builder::macro('search', function ($field, $string) {
|
||||
return $string ? $this->where($field, 'like', '%' . $string . '%') : $this;
|
||||
});
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Actions\Jetstream\DeleteUser;
|
||||
use Illuminate\Support\Facades\Vite;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Jetstream\Jetstream;
|
||||
|
||||
@@ -25,8 +24,6 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
$this->configurePermissions();
|
||||
|
||||
Jetstream::deleteUsersUsing(DeleteUser::class);
|
||||
|
||||
Vite::prefetch(concurrency: 3);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
@@ -10,9 +9,7 @@ define('LARAVEL_START', microtime(true));
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the command...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
$status = $app->handleCommand(new ArgvInput);
|
||||
$status = (require_once __DIR__.'/bootstrap/app.php')
|
||||
->handleCommand(new ArgvInput);
|
||||
|
||||
exit($status);
|
||||
|
||||
+8
-10
@@ -6,23 +6,21 @@
|
||||
"keywords": ["laravel", "framework"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.4",
|
||||
"laravel/framework": "^12.0",
|
||||
"php": "^8.2",
|
||||
"laravel/framework": "^11.31",
|
||||
"laravel/jetstream": "^5.3",
|
||||
"laravel/sanctum": "^4.0",
|
||||
"laravel/tinker": "^2.10.1",
|
||||
"livewire/flux": "^2.0",
|
||||
"laravel/tinker": "^2.9",
|
||||
"livewire/livewire": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
"laravel/pail": "^1.2.2",
|
||||
"laravel/pail": "^1.1",
|
||||
"laravel/pint": "^1.13",
|
||||
"laravel/sail": "^1.41",
|
||||
"laravel/sail": "^1.26",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.6",
|
||||
"pestphp/pest": "^3.7",
|
||||
"pestphp/pest-plugin-laravel": "^3.1"
|
||||
"nunomaduro/collision": "^8.1",
|
||||
"phpunit/phpunit": "^11.0.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -54,7 +52,7 @@
|
||||
],
|
||||
"dev": [
|
||||
"Composer\\Config::disableProcessTimeout",
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve --host=0.0.0.0 --port=${LARAVEL_PORT_NUMBER}\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
|
||||
Generated
+956
-2258
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -65,7 +65,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ return [
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group type of items stored in your caches.
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "array", "database", "file", "memcached",
|
||||
| "redis", "dynamodb", "octane", "null"
|
||||
|
||||
@@ -148,7 +148,6 @@ return [
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
'persistent' => env('REDIS_PERSISTENT', false),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => (int) env('SESSION_LIFETIME', 120),
|
||||
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
<?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('filament_types', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('filament_types');
|
||||
}
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
<?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('colors', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->required();
|
||||
$table->string('hex')->required();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('color');
|
||||
}
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
<?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('manufacturers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->required();
|
||||
$table->string('description')->nullable();
|
||||
$table->string('website')->nullable();
|
||||
$table->string('logo')->nullable();
|
||||
$table->integer('filament_count')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('manufacturer');
|
||||
}
|
||||
};
|
||||
@@ -1,37 +0,0 @@
|
||||
<?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('filaments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->foreignId('color_id')->constrained('colors')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreignId('manufacturer_id')->constrained('manufacturers')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreignId('filament_type_id')->constrained('filament_types')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->integer('weight');
|
||||
$table->decimal('diameter', 10, 2);
|
||||
$table->decimal('price', 10, 2)->nullable();
|
||||
$table->integer('temp_min')->nullable();
|
||||
$table->integer('temp_max')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('filaments');
|
||||
}
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
<?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('extruders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->foreignId('manufacturer_id')->constrained();
|
||||
$table->string('diameter')->required();
|
||||
$table->integer('temp_max')->required();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('extruders');
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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('buildplates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->foreignId('manufacturer_id')->constrained('manufacturers');
|
||||
$table->integer('temp_max');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('buildplate');
|
||||
}
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
<?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('order_statuses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('order_statuses');
|
||||
}
|
||||
};
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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('orders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->foreignId('order_status_id')->constrained();
|
||||
$table->json('items');
|
||||
$table->integer('total_price');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('orders');
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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('spareparts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->foreignId('manufacturer_id')->constrained('manufacturers')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('spareparts');
|
||||
}
|
||||
};
|
||||
@@ -1,34 +0,0 @@
|
||||
<?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('printertypes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->foreignId('manufacturer_id')->constrained('manufacturers')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->string('temp_max')->nullable();
|
||||
$table->decimal('bed_size_x', 5, 2)->default(0);
|
||||
$table->decimal('bed_size_y', 5, 2)->default(0);
|
||||
$table->decimal('price', 10, 2)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('printertypes');
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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('printers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->foreignId('printertype_id')->constrained('printertypes')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('printers');
|
||||
}
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
<?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('calculatorpresets', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->decimal('price_kwh', 10, 2);
|
||||
$table->decimal('factor_printer', 10, 2);
|
||||
$table->decimal('factor_maintenance', 10, 2);
|
||||
$table->decimal('factor_price', 10, 2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('calculatorpresets');
|
||||
}
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Buildplate as Type;
|
||||
|
||||
class BuildplateSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create Predefined Filament Types
|
||||
$buildplates = [
|
||||
['name' => 'SuperTrack', 'description' => 'Standard BuildPlate.', 'manufacturer_id' => 1, 'temp_max' => '250'],
|
||||
['name' => 'Smooth PEI', 'description' => 'Standard BuildPlate.', 'manufacturer_id' => 1, 'temp_max' => '250'],
|
||||
];
|
||||
|
||||
foreach ($buildplates as $buildplate) {
|
||||
Type::create($buildplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CalculationpresetSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
// Seed Calculation Presets
|
||||
$calculationpresets = [
|
||||
['name' => 'Standard', 'price_kwh' => 0.30, 'factor_printer' => 0.20, 'factor_maintenance' => 0.20, 'factor_price' => 200],
|
||||
['name' => 'Friends', 'price_kwh' => 0.30, 'factor_printer' => 0.20, 'factor_maintenance' => 0.20, 'factor_price' => 150],
|
||||
['name' => 'Extra', 'price_kwh' => 0.30, 'factor_printer' => 0.20, 'factor_maintenance' => 0.20, 'factor_price' => 250],
|
||||
['name' => 'Production', 'price_kwh' => 0.30, 'factor_printer' => 0.20, 'factor_maintenance' => 0.20, 'factor_price' => 100],
|
||||
];
|
||||
|
||||
foreach ($calculationpresets as $preset) {
|
||||
\App\Models\Calculationpreset::create($preset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Color;
|
||||
|
||||
class ColorSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Seed predefined Colors
|
||||
$colors = [
|
||||
['name' => 'Red', 'hex' => 'FF0000'],
|
||||
['name' => 'Green', 'hex' => '00FF00'],
|
||||
['name' => 'Blue', 'hex' => '0000FF'],
|
||||
['name' => 'Yellow', 'hex' => 'FFFF00'],
|
||||
['name' => 'Orange', 'hex' => 'FFA500'],
|
||||
['name' => 'Purple', 'hex' => '800080'],
|
||||
['name' => 'Pink', 'hex' => 'FFC0CB'],
|
||||
['name' => 'Brown', 'hex' => 'A52A2A'],
|
||||
['name' => 'Gray', 'hex' => '808080'],
|
||||
['name' => 'Black', 'hex' => '000000'],
|
||||
['name' => 'White', 'hex' => 'FFFFFF'],
|
||||
['name' => 'Gold', 'hex' => 'FFD700'],
|
||||
['name' => 'Silver', 'hex' => 'C0C0C0'],
|
||||
['name' => 'Cyan', 'hex' => '00FFFF']
|
||||
];
|
||||
|
||||
foreach ($colors as $color) {
|
||||
Color::create($color);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,9 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\User;
|
||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Database\Seeders\ColorSeeder;
|
||||
use Database\Seeders\ManufacturerSeeder;
|
||||
use Database\Seeders\FilamentTypeSeeder;
|
||||
use Database\Seeders\OrderStatusSeeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
@@ -16,24 +13,11 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
User::factory(10)->create();
|
||||
// User::factory(10)->create();
|
||||
|
||||
User::create([
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@local',
|
||||
'password' => bcrypt('password')
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
|
||||
$this ->call([
|
||||
ColorSeeder::class,
|
||||
ManufacturerSeeder::class,
|
||||
FilamentTypeSeeder::class,
|
||||
OrderStatusSeeder::class,
|
||||
BuildplateSeeder::class,
|
||||
CalculationpresetSeeder::class,
|
||||
PrintertypeSeeder::class,
|
||||
FilamentSeeder::class,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class FilamentSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Seed predefined Filaments
|
||||
$filaments = [
|
||||
['name' => 'Bambu PLA Basic', 'manufacturer_id' => 1, 'filament_type_id' => 1, 'color_id' => 10, 'temp_max' => 230, 'temp_min' => 180, 'price' => 19.99, 'weight' => 1000, 'diameter' => '1.75'],
|
||||
['name' => 'Bambu PLA Basic', 'manufacturer_id' => 1, 'filament_type_id' => 1, 'color_id' => 11, 'temp_max' => 230, 'temp_min' => 180, 'price' => 19.99, 'weight' => 1000, 'diameter' => '1.75'],
|
||||
|
||||
];
|
||||
|
||||
foreach ($filaments as $filament) {
|
||||
\App\Models\Filament::create($filament);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\FilamentType as Type;
|
||||
|
||||
class FilamentTypeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create Predefined Filament Types
|
||||
$filamentTypes = [
|
||||
['name' => 'PLA', 'description' => 'Standard filament type.'],
|
||||
['name' => 'PETG', 'description' => 'Premium filament type.'],
|
||||
];
|
||||
|
||||
foreach ($filamentTypes as $filamentType) {
|
||||
Type::create($filamentType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Manufacturer;
|
||||
|
||||
class ManufacturerSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create predefined Manufacturers
|
||||
$manufacturers = [
|
||||
['name' => 'Bambulab', 'description' => 'Bambulab is a manufacturer of high quality products.', 'website' => 'https://bambulab.com', 'logo' => ''],
|
||||
['name' => 'Sunlu', 'description' => 'Sunlu is a manufacturer of high quality products.', 'website' => 'https://sunlu.com', 'logo' => '']
|
||||
|
||||
];
|
||||
|
||||
foreach ($manufacturers as $manufacturer) {
|
||||
Manufacturer::create($manufacturer);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\OrderStatus;
|
||||
|
||||
class OrderStatusSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Define Order Statuses
|
||||
$orderStatuses = [
|
||||
['name' => 'Ordered'],
|
||||
['name' => 'Shipped'],
|
||||
['name' => 'Delivered']
|
||||
];
|
||||
|
||||
foreach ($orderStatuses as $orderStatus) {
|
||||
OrderStatus::create($orderStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Printertype;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PrintertypeSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create Predefined Printer Types
|
||||
$printertypes = [
|
||||
['name' => 'Bambulab P1S', 'manufacturer_id' => 1, 'description' => 'Standard printer type.', 'temp_max' => '300', 'bed_size_x' => '25.6', 'bed_size_y' => '25.6', 'price' => 559],
|
||||
['name' => 'Bambulab P2S', 'manufacturer_id' => 1, 'description' => 'Standard printer type.', 'temp_max' => '300', 'bed_size_x' => '25.6', 'bed_size_y' => '25.6', 'price' => 749],
|
||||
];
|
||||
|
||||
foreach ($printertypes as $printertype) {
|
||||
Printertype::create($printertype);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
MIT: https://spdx.org/licenses/MIT.html
|
||||
Generated
+1677
-1153
File diff suppressed because it is too large
Load Diff
+4
-5
@@ -7,14 +7,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"axios": "^1.7.4",
|
||||
"concurrently": "^9.0.1",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"laravel-vite-plugin": "^1.0",
|
||||
"postcss": "^8.4.32",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"vite": "^6.0.11"
|
||||
"tailwindcss": "^3.4.0",
|
||||
"vite": "^6.0"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
'@tailwindcss/postcss': {},
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
|
||||
+2
-5
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
@@ -14,7 +13,5 @@ if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php'))
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
// Bootstrap Laravel and handle the request...
|
||||
/** @var Application $app */
|
||||
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->handleRequest(Request::capture());
|
||||
(require_once __DIR__.'/../bootstrap/app.php')
|
||||
->handleRequest(Request::capture());
|
||||
|
||||
+3
-137
@@ -1,140 +1,6 @@
|
||||
@import 'tailwindcss';
|
||||
@import '../../vendor/livewire/flux/dist/flux.css';
|
||||
|
||||
@plugin '@tailwindcss/forms';
|
||||
@plugin '@tailwindcss/typography';
|
||||
|
||||
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
||||
@source '../../vendor/laravel/jetstream/**/*.blade.php';
|
||||
|
||||
@theme {
|
||||
--font-sans: Inter, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
|
||||
--color-jet: #33312e;
|
||||
--color-pumpkin: #FE7F2D;
|
||||
--color-olivine: #A1C181;
|
||||
|
||||
--color-cornflower: #8ecae6;
|
||||
--color-pacific: #219ebc;
|
||||
--color-elephant: #023047;
|
||||
--color-selective: #ffb703;
|
||||
--color-gold-drop: #fb8500;
|
||||
|
||||
--color-jet-50: #f6f5f5;
|
||||
--color-jet-100: #e8e6e5;
|
||||
--color-jet-200: #d3d0ce;
|
||||
--color-jet-300: #b5afab;
|
||||
--color-jet-400: #8f8781;
|
||||
--color-jet-500: #746c66;
|
||||
--color-jet-600: #635e57;
|
||||
--color-jet-700: #53504b;
|
||||
--color-jet-800: #484542;
|
||||
--color-jet-900: #3f3d3a;
|
||||
--color-jet-950: #33312e;
|
||||
|
||||
--color-pumpkin-50: #fff6ed;
|
||||
--color-pumpkin-100: #ffebd4;
|
||||
--color-pumpkin-200: #ffd2a9;
|
||||
--color-pumpkin-300: #ffb272;
|
||||
--color-pumpkin-400: #FE7F2D;
|
||||
--color-pumpkin-500: #fd6412;
|
||||
--color-pumpkin-600: #ee4a08;
|
||||
--color-pumpkin-700: #c53509;
|
||||
--color-pumpkin-800: #9c2b10;
|
||||
--color-pumpkin-900: #7e2610;
|
||||
--color-pumpkin-950: #440f06;
|
||||
|
||||
--color-olivine-50: #f3f7ee;
|
||||
--color-olivine-100: #e4edda;
|
||||
--color-olivine-200: #ccdeb8;
|
||||
--color-olivine-300: #a1c181;
|
||||
--color-olivine-400: #8cb16a;
|
||||
--color-olivine-500: #6f964c;
|
||||
--color-olivine-600: #55763a;
|
||||
--color-olivine-700: #435b30;
|
||||
--color-olivine-800: #384a2a;
|
||||
--color-olivine-900: #324027;
|
||||
--color-olivine-950: #182211;
|
||||
|
||||
--color-cornflower-50: #f2f9fd;
|
||||
--color-cornflower-100: #e5f1f9;
|
||||
--color-cornflower-200: #c5e3f2;
|
||||
--color-cornflower-300: #8ecae6;
|
||||
--color-cornflower-400: #58b2d8;
|
||||
--color-cornflower-500: #3298c5;
|
||||
--color-cornflower-600: #237ba6;
|
||||
--color-cornflower-700: #1d6187;
|
||||
--color-cornflower-800: #1c5370;
|
||||
--color-cornflower-900: #1c465e;
|
||||
--color-cornflower-950: #132d3e;
|
||||
|
||||
--color-pacific-50: #eefbfd;
|
||||
--color-pacific-100: #d5f3f8;
|
||||
--color-pacific-200: #b0e7f1;
|
||||
--color-pacific-300: #7ad5e6;
|
||||
--color-pacific-400: #3cb9d4;
|
||||
--color-pacific-500: #219ebc;
|
||||
--color-pacific-600: #1e7e9c;
|
||||
--color-pacific-700: #1f657f;
|
||||
--color-pacific-800: #215569;
|
||||
--color-pacific-900: #204659;
|
||||
--color-pacific-950: #102e3c;
|
||||
|
||||
--color-elephant-50: #effaff;
|
||||
--color-elephant-100: #ddf5ff;
|
||||
--color-elephant-200: #b4edff;
|
||||
--color-elephant-300: #72e0ff;
|
||||
--color-elephant-400: #27d2ff;
|
||||
--color-elephant-500: #00bdfc;
|
||||
--color-elephant-600: #0098d9;
|
||||
--color-elephant-700: #0079af;
|
||||
--color-elephant-800: #006690;
|
||||
--color-elephant-900: #035477;
|
||||
--color-elephant-950: #023047;
|
||||
|
||||
--color-selective-50: #fffeea;
|
||||
--color-selective-100: #fff9c5;
|
||||
--color-selective-200: #fff485;
|
||||
--color-selective-300: #ffe746;
|
||||
--color-selective-400: #ffd71b;
|
||||
--color-selective-500: #ffb703;
|
||||
--color-selective-600: #e28b00;
|
||||
--color-selective-700: #bb6202;
|
||||
--color-selective-800: #984b08;
|
||||
--color-selective-900: #7c3e0b;
|
||||
--color-selective-950: #481f00;
|
||||
|
||||
--color-gold-drop-50: #fffbec;
|
||||
--color-gold-drop-100: #fff5d3;
|
||||
--color-gold-drop-200: #ffe8a5;
|
||||
--color-gold-drop-300: #ffd56d;
|
||||
--color-gold-drop-400: #ffb732;
|
||||
--color-gold-drop-500: #ff9f0a;
|
||||
--color-gold-drop-600: #fb8500;
|
||||
--color-gold-drop-700: #cc6302;
|
||||
--color-gold-drop-800: #a14c0b;
|
||||
--color-gold-drop-900: #82400c;
|
||||
--color-gold-drop-950: #461e04;
|
||||
}
|
||||
|
||||
/*
|
||||
The default border color has changed to `currentColor` in Tailwind CSS v4,
|
||||
so we've added these compatibility styles to make sure everything still
|
||||
looks the same as it did with Tailwind CSS v3.
|
||||
|
||||
If we ever want to remove these styles, we need to add an explicit border
|
||||
color utility to any element that depends on these defaults.
|
||||
*/
|
||||
@layer base {
|
||||
*,
|
||||
::after,
|
||||
::before,
|
||||
::backdrop,
|
||||
::file-selector-button {
|
||||
border-color: var(--color-gray-200, currentColor);
|
||||
}
|
||||
}
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
[x-cloak] {
|
||||
display: none;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<!-- Token Name -->
|
||||
<div class="col-span-6 sm:col-span-4">
|
||||
<x-label for="name" value="{{ __('Token Name') }}" />
|
||||
<x-input id="name" type="text" class="mt-1 block w-full" wire:model.live="createApiTokenForm.name" autofocus />
|
||||
<x-input id="name" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name" autofocus />
|
||||
<x-input-error for="name" class="mt-2" />
|
||||
</div>
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
<div class="mt-2 grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
|
||||
<label class="flex items-center">
|
||||
<x-checkbox wire:model.live="createApiTokenForm.permissions" :value="$permission"/>
|
||||
<span class="ms-2 text-sm text-gray-600 dark:text-gray-400">{{ $permission }}</span>
|
||||
<x-checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
|
||||
<span class="ms-2 text-sm text-gray-600">{{ $permission }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -64,7 +64,7 @@
|
||||
<div class="space-y-6">
|
||||
@foreach ($this->user->tokens->sortBy('name') as $token)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="break-all dark:text-white">
|
||||
<div class="break-all">
|
||||
{{ $token->name }}
|
||||
</div>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</div>
|
||||
|
||||
<x-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
|
||||
class="mt-4 bg-gray-100 px-4 py-2 rounded-sm font-mono text-sm text-gray-500 w-full break-all"
|
||||
class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full break-all"
|
||||
autofocus autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
@showing-token-modal.window="setTimeout(() => $refs.plaintextToken.select(), 250)"
|
||||
/>
|
||||
@@ -128,8 +128,8 @@
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
|
||||
<label class="flex items-center">
|
||||
<x-checkbox wire:model.live="updateApiTokenForm.permissions" :value="$permission"/>
|
||||
<span class="ms-2 text-sm text-gray-600 dark:text-gray-400">{{ $permission }}</span>
|
||||
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
|
||||
<span class="ms-2 text-sm text-gray-600">{{ $permission }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<x-app-layout>
|
||||
<x-slot name="header">
|
||||
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
||||
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
|
||||
{{ __('API Tokens') }}
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user