Initial commit

This commit is contained in:
2025-03-22 10:19:15 +00:00
commit f6dc8ec59a
1352 changed files with 124438 additions and 0 deletions

18
.editorconfig Normal file
View File

@ -0,0 +1,18 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
[docker-compose.yml]
indent_size = 4

65
.env.example Normal file
View File

@ -0,0 +1,65 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database
PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=sqlite
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=workshop
# DB_USERNAME=root
# DB_PASSWORD=
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database
CACHE_STORE=database
# CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"

11
.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
* text=auto eol=lf
*.blade.php diff=html
*.css diff=css
*.html diff=html
*.md diff=markdown
*.php diff=php
/.github export-ignore
CHANGELOG.md export-ignore
.styleci.yml export-ignore

23
.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/auth.json
/.fleet
/.idea
/.nova
/.vscode
/.zed

66
README.md Normal file
View File

@ -0,0 +1,66 @@
<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>
<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>
## About Laravel
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:
- [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).
Laravel is accessible, powerful, and provides tools required for large, robust applications.
## Learning Laravel
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.
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
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.
## Laravel Sponsors
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).
### Premium Partners
- **[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)**
## Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
## Code of Conduct
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).
## Security Vulnerabilities
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
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

View File

@ -0,0 +1,8 @@
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}

View File

@ -0,0 +1,42 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\RepairOrder;
use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Http\Response;
class RepairReportController extends Controller
{
/**
* Generate a repair report PDF
*
* @param int $repairId
* @return Response
*/
public function generateReport(int $repairId): Response
{
$repair = RepairOrder::with([
'vehicle',
'technicians',
'parts',
'repairTasks',
'documents'
])->findOrFail($repairId);
$data = [
'repair' => $repair,
'companyName' => config('app.name'),
'address' => '123 Repair Lane, Workshop City',
'phone' => '555-123-4567',
'email' => 'service@workshopfleet.com',
'website' => 'www.workshopfleet.com',
'generatedAt' => now()->format('Y-m-d H:i:s'),
];
$pdf = PDF::loadView('reports.repair', $data);
return $pdf->download('repair-report-' . $repair->order_number . '.pdf');
}
}

32
app/Models/Document.php Normal file
View File

@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Document extends Model
{
use HasFactory;
protected $fillable = [
'documentable_id',
'documentable_type',
'name',
'file_path',
'file_type',
'file_size',
'uploaded_by',
];
public function documentable()
{
return $this->morphTo();
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class MaintenanceSchedule extends Model
{
use HasFactory;
protected $fillable = [
'vehicle_id',
'name',
'description',
'mileage_interval',
'day_interval',
'last_performed',
'last_mileage',
'next_due_date',
'next_due_mileage',
'is_active',
];
protected $casts = [
'last_performed' => 'date',
'next_due_date' => 'date',
'is_active' => 'boolean',
];
public function vehicle(): BelongsTo
{
return $this->belongsTo(Vehicle::class);
}
}

35
app/Models/Part.php Normal file
View File

@ -0,0 +1,35 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Part extends Model
{
use HasFactory;
protected $fillable = [
'part_number',
'name',
'description',
'cost',
'quantity_in_stock',
'reorder_level',
'location',
'manufacturer',
];
public function repairOrders(): BelongsToMany
{
return $this->belongsToMany(RepairOrder::class)
->withPivot('quantity_used', 'unit_cost')
->withTimestamps();
}
}

101
app/Models/RepairOrder.php Normal file
View File

@ -0,0 +1,101 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class RepairOrder extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'order_number',
'vehicle_id',
'priority',
'status',
'reported_at',
'assigned_at',
'started_at',
'completed_at',
'issue_description',
'diagnosis',
'resolution',
'mileage_at_repair',
'labor_hours',
'labor_cost',
'parts_cost',
'total_cost',
];
protected $casts = [
'reported_at' => 'datetime',
'assigned_at' => 'datetime',
'started_at' => 'datetime',
'completed_at' => 'datetime',
'labor_hours' => 'decimal:2',
'labor_cost' => 'decimal:2',
'parts_cost' => 'decimal:2',
'total_cost' => 'decimal:2',
];
public function vehicle(): BelongsTo
{
return $this->belongsTo(Vehicle::class);
}
public function technicians(): BelongsToMany
{
return $this->belongsToMany(Technician::class)
->withPivot('is_lead')
->withTimestamps();
}
public function parts(): BelongsToMany
{
return $this->belongsToMany(Part::class)
->withPivot('quantity_used', 'unit_cost')
->withTimestamps();
}
public function repairTasks(): HasMany
{
return $this->hasMany(RepairTask::class);
}
public function documents(): MorphMany
{
return $this->morphMany(Document::class, 'documentable');
}
public function getLeadTechnician()
{
return $this->technicians()->wherePivot('is_lead', true)->first();
}
public function calculateCosts()
{
// Calculate parts cost
$this->parts_cost = $this->parts()
->withPivot('quantity_used', 'unit_cost')
->get()
->sum(function ($part) {
return $part->pivot->quantity_used * $part->pivot->unit_cost;
});
// Calculate labor cost based on tasks
$this->labor_hours = $this->repairTasks()->sum('actual_hours');
$this->labor_cost = $this->labor_hours * config('workshop.hourly_rate', 85.00);
// Calculate total cost
$this->total_cost = $this->parts_cost + $this->labor_cost;
$this->save();
}
}

46
app/Models/RepairTask.php Normal file
View File

@ -0,0 +1,46 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class RepairTask extends Model
{
use HasFactory;
protected $fillable = [
'repair_order_id',
'name',
'description',
'status',
'technician_id',
'estimated_hours',
'actual_hours',
'started_at',
'completed_at',
];
protected $casts = [
'estimated_hours' => 'decimal:2',
'actual_hours' => 'decimal:2',
'started_at' => 'datetime',
'completed_at' => 'datetime',
];
public function repairOrder(): BelongsTo
{
return $this->belongsTo(RepairOrder::class);
}
public function technician(): BelongsTo
{
return $this->belongsTo(Technician::class);
}
}

41
app/Models/Technician.php Normal file
View File

@ -0,0 +1,41 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Technician extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'name',
'employee_id',
'email',
'phone',
'specialization',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
];
public function repairOrders(): BelongsToMany
{
return $this->belongsToMany(RepairOrder::class)
->withPivot('is_lead')
->withTimestamps();
}
public function repairTasks(): HasMany
{
return $this->hasMany(RepairTask::class);
}
}

48
app/Models/User.php Normal file
View File

@ -0,0 +1,48 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}

44
app/Models/Vehicle.php Normal file
View File

@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Vehicle extends Model
{
use HasFactory, SoftDeletes;
protected $fillable = [
'fleet_number',
'license_plate',
'make',
'model',
'year',
'vin',
'color',
'mileage',
'status',
'notes',
];
public function repairOrders(): HasMany
{
return $this->hasMany(RepairOrder::class);
}
public function maintenanceSchedules(): HasMany
{
return $this->hasMany(MaintenanceSchedule::class);
}
public function documents(): MorphMany
{
return $this->morphMany(Document::class, 'documentable');
}
}

View File

@ -0,0 +1,80 @@
<?php
namespace App\Nova\Actions;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use Carbon\Carbon;
class AssignTechnicians extends Action
{
use InteractsWithQueue, Queueable;
public $name = 'Assign Technicians';
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
// Clear previous assignments if requested
if ($fields->clear_previous) {
$model->technicians()->detach();
}
// Assign selected technicians
foreach ($fields->technicians as $techId) {
// Check if already assigned
if (!$model->technicians->contains($techId)) {
$model->technicians()->attach($techId, [
'is_lead' => in_array($techId, $fields->lead_technicians) ? true : false
]);
}
}
// Update status if needed
if ($model->status === 'pending') {
$model->status = 'in_progress';
$model->assigned_at = Carbon::now();
$model->started_at = Carbon::now();
// Update vehicle status
$vehicle = $model->vehicle;
$vehicle->status = 'in_repair';
$vehicle->save();
}
$model->save();
}
return Action::message('Technicians have been assigned successfully.');
}
public function fields(NovaRequest $request): array
{
return [
BelongsToMany::make('Technicians')
->rules('required'),
BelongsToMany::make('Lead Technicians', 'technicians', 'App\Nova\Technician')
->help('Select technicians who will lead this repair'),
Boolean::make('Clear Previous Assignments', 'clear_previous')
->help('Remove all previously assigned technicians')
->default(false),
];
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace App\Nova\Actions;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use Carbon\Carbon;
class CompleteRepair extends Action
{
use InteractsWithQueue, Queueable;
public $name = 'Mark as Completed';
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
if (!in_array($model->status, ['completed', 'cancelled'])) {
$model->status = 'completed';
$model->completed_at = Carbon::now();
$model->resolution = $fields->resolution;
$model->calculateCosts();
$model->save();
// Update vehicle status
$vehicle = $model->vehicle;
$vehicle->status = 'active';
$vehicle->mileage = $fields->final_mileage;
$vehicle->save();
return Action::message('Repair has been marked as completed.');
}
}
return Action::danger('Cannot complete repairs that are already completed or cancelled.');
}
public function fields(NovaRequest $request): array
{
return [
Textarea::make('Resolution')
->rules('required')
->help('Describe what was done to resolve the issue'),
Number::make('Final Mileage')
->rules('required', 'numeric', 'min:0')
->help('Update the current mileage of the vehicle'),
];
}
}

View File

@ -0,0 +1,39 @@
<?php
namespace App\Nova\Actions;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use Carbon\Carbon;
class GenerateRepairReport extends Action
{
use InteractsWithQueue, Queueable;
public $name = 'Generate Report';
public function handle(ActionFields $fields, Collection $models)
{
// In a real implementation, this would generate a PDF report
// For now, we'll just return a message
return Action::download(
route('repair.report', ['repairId' => $models->first()->id]),
'repair-report-' . $models->first()->order_number . '.pdf'
);
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Nova\Actions;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Collection;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Fields\ActionFields;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use Carbon\Carbon;
class OrderParts extends Action
{
use InteractsWithQueue, Queueable;
public $name = 'Order Parts';
public function handle(ActionFields $fields, Collection $models): \Laravel\Nova\Actions\ActionResponse
{
foreach ($models as $part) {
// In a real implementation, this would create a purchase order
// For now, we'll just update the quantity
$part->quantity_in_stock += $fields->quantity;
$part->save();
}
return Action::message('Parts have been ordered successfully.');
}
public function fields(NovaRequest $request): array
{
return [
Number::make('Quantity')
->rules('required', 'numeric', 'min:1')
->default(1),
];
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Nova\Dashboards;
use Laravel\Nova\Cards\Help;
use Laravel\Nova\Dashboards\Main as Dashboard;
class Main extends Dashboard
{
/**
* Get the cards for the dashboard.
*
* @return array<int, \Laravel\Nova\Card>
*/
public function cards(): array
{
return [
new Help,
];
}
}

View File

@ -0,0 +1,47 @@
<?php
namespace App\Nova\Dashboards;
use Laravel\Nova\Dashboard;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
class WorkshopDashboard extends Dashboard
{
/**
* Get the displayable name of the dashboard.
*
* @return string
*/
public function name(): string
{
return 'Workshop Overview';
}
/**
* Get the cards for the dashboard.
*
* @return array
*/
public function cards(): array
{
return [
new VehiclesPerStatus(),
new RepairsPerMonth(),
new AverageRepairCost(),
new PartsInventoryValue(),
];
}
/**
* Get the URI key for the dashboard.
*
* @return string
*/
public function uriKey(): string
{
return 'workshop-dashboard';
}
}

74
app/Nova/Document.php Normal file
View File

@ -0,0 +1,74 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class Document extends Resource
{
public static string $model = \App\Models\Document::class;
public static $title = 'name';
public static $search = ['name'];
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Text::make('Name')
->sortable()
->rules('required'),
File::make('File', 'file_path')
->disk('public')
->path('documents')
->prunable()
->rules('required')
->creationRules('required'),
Text::make('File Type')
->sortable()
->readonly(),
Number::make('File Size')
->sortable()
->readonly()
->displayUsing(function ($value) {
return number_format($value / 1024, 2) . ' KB';
}),
Text::make('Uploaded By')
->sortable()
->readonly(),
];
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Nova\Filters;
use Illuminate\Contracts\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Laravel\Nova\Filters\Filter;
class RepairStatusFilter extends Filter
{
public $name = 'Repair Status';
public function apply(Request $request, $query, $value): Builder
{
return $query->where('status', $value);
}
public function options(Request $request): array
{
return [
'Pending' => 'pending',
'In Progress' => 'in_progress',
'Parts Ordered' => 'parts_ordered',
'On Hold' => 'on_hold',
'Completed' => 'completed',
'Cancelled' => 'cancelled',
];
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Nova\Filters;
use Illuminate\Contracts\Database\Eloquent\Builder;
use Illuminate\Http\Request;
use Laravel\Nova\Filters\Filter;
class TechnicianSpecializationFilter extends Filter
{
public $name = 'Specialization';
public function apply(Request $request, $query, $value): Builder
{
return $query->where('specialization', $value);
}
public function options(Request $request): array
{
return [
'Mechanical' => 'mechanical',
'Electrical' => 'electrical',
'Body Work' => 'body',
'General' => 'general',
];
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Nova\Filters;
use Illuminate\Http\Request;
use Laravel\Nova\Filters\Filter;
class VehicleStatusFilter extends Filter
{
public $name = 'Vehicle Status';
public function apply(Request $request, $query, $value): \Illuminate\Contracts\Database\Eloquent\Builder
{
return $query->where('status', $value);
}
public function options(Request $request): array
{
return [
'Active' => 'active',
'In Repair' => 'in_repair',
'Out of Service' => 'out_of_service',
];
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\Nova\Lenses;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Http\Requests\LensRequest;
use Laravel\Nova\Lenses\Lens;
use Illuminate\Http\Request;
use App\Models\Vehicle;
use App\Models\MaintenanceSchedule;
use App\Models\Part;
use Carbon\Carbon;
class LowInventoryParts extends Lens
{
public static function query(LensRequest $request, $query)
{
return $request->withOrdering($request->withFilters(
$query->whereColumn('quantity_in_stock', '<=', 'reorder_level')
));
}
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Text::make('Part Number')
->sortable(),
Text::make('Name')
->sortable(),
Number::make('Quantity In Stock')
->sortable(),
Number::make('Reorder Level')
->sortable(),
Text::make('Manufacturer')
->sortable(),
];
}
public function uriKey(): string
{
return 'low-inventory-parts';
}
}

View File

@ -0,0 +1,81 @@
<?php
namespace App\Nova\Lenses;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Http\Requests\LensRequest;
use Laravel\Nova\Lenses\Lens;
use Illuminate\Http\Request;
use App\Models\Vehicle;
use App\Models\MaintenanceSchedule;
use App\Models\Part;
use Carbon\Carbon;
class VehiclesDueForMaintenance extends Lens
{
public static function query(LensRequest $request, $query)
{
return $request->withOrdering($request->withFilters(
$query->select('vehicles.*')
->join('maintenance_schedules', 'vehicles.id', '=', 'maintenance_schedules.vehicle_id')
->where(function ($query) {
$query->where('maintenance_schedules.next_due_date', '<=', Carbon::now()->addDays(30))
->orWhereRaw('vehicles.mileage + 500 >= maintenance_schedules.next_due_mileage');
})
->where('maintenance_schedules.is_active', true)
->distinct()
));
}
public function fields(Request $request)
{
return [
ID::make()->sortable(),
Text::make('Fleet Number')
->sortable(),
Text::make('Make')
->sortable(),
Text::make('Model')
->sortable(),
Number::make('Mileage')
->sortable(),
Text::make('Status')
->sortable(),
Date::make('Next Maintenance', function () {
return $this->maintenanceSchedules()
->where('is_active', true)
->orderBy('next_due_date')
->first()
->next_due_date ?? null;
}),
Number::make('Miles Until Maintenance', function () {
$nextDueMileage = $this->maintenanceSchedules()
->where('is_active', true)
->orderBy('next_due_mileage')
->first()
->next_due_mileage ?? 0;
return $nextDueMileage > 0 ? $nextDueMileage - $this->mileage : 0;
}),
];
}
public function uriKey()
{
return 'vehicles-due-for-maintenance';
}
}

View File

@ -0,0 +1,89 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class MaintenanceSchedule extends Resource
{
public static string $model = \App\Models\MaintenanceSchedule::class;
public static $title = 'name';
public static $search = ['name', 'description'];
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
BelongsTo::make('Vehicle')
->searchable()
->rules('required'),
Text::make('Name')
->sortable()
->rules('required'),
Textarea::make('Description')
->hideFromIndex()
->nullable(),
Number::make('Mileage Interval')
->sortable()
->nullable()
->help('Distance in miles between maintenance'),
Number::make('Day Interval')
->sortable()
->nullable()
->help('Number of days between maintenance'),
Date::make('Last Performed')
->sortable()
->nullable(),
Number::make('Last Mileage')
->sortable()
->nullable(),
Date::make('Next Due Date')
->sortable()
->nullable(),
Number::make('Next Due Mileage')
->sortable()
->nullable(),
Boolean::make('Is Active')
->sortable(),
];
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Nova\Metrics;
use Laravel\Nova\Metrics\Value;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\RepairOrder;
use Laravel\Nova\Metrics\ValueResult;
class AverageRepairCost extends Value
{
/**
* Calculate the value of the metric.
*/
public function calculate(NovaRequest $request): ValueResult
{
return $this->average($request, RepairOrder::class, 'total_cost')
->format('$0,0.00') // Correct way to format currency
->allowZeroResult();
}
/**
* Get the metric's URI key.
*/
public function uriKey()
{
return 'average-repair-cost';
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Nova\Metrics;
use Laravel\Nova\Metrics\Value;
use Laravel\Nova\Metrics\Trend;
use Laravel\Nova\Metrics\Partition;
use App\Models\Vehicle;
use App\Models\RepairOrder;
use App\Models\Part;
class PartsInventoryValue extends Value
{
public function calculate(): \Laravel\Nova\Metrics\ValueResult
{
$totalValue = Part::query()
->selectRaw('SUM(cost * quantity_in_stock) as total_value')
->first()
->total_value ?? 0;
return $this->result($totalValue)->currency('$');
}
public function uriKey(): string
{
return 'parts-inventory-value';
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Nova\Metrics;
use Laravel\Nova\Metrics\Trend;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\RepairOrder;
class RepairsPerMonth extends Trend
{
/**
* Calculate the trend metric.
*/
public function calculate(NovaRequest $request)
{
return $this->countByMonths($request, RepairOrder::class, 'created_at');
}
/**
* Get the metric's URI key.
*/
public function uriKey(): string
{
return 'repairs-per-month';
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Nova\Metrics;
use Laravel\Nova\Metrics\Partition;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Models\Vehicle;
use Laravel\Nova\Metrics\PartitionResult;
class VehiclesPerStatus extends Partition
{
/**
* Calculate the partition metric.
*/
public function calculate(NovaRequest $request): PartitionResult
{
return $this->count($request, Vehicle::class, 'status')
->label(function ($value) {
return ucfirst(str_replace('_', ' ', $value));
});
}
/**
* Get the metric's URI key.
*/
public function uriKey()
{
return 'vehicles-per-status';
}
}

101
app/Nova/Part.php Normal file
View File

@ -0,0 +1,101 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class Part extends Resource
{
public static string $model = \App\Models\Part::class;
public static $title = 'name';
public static $search = ['name', 'part_number', 'description'];
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Text::make('Part Number')
->sortable()
->rules('required', 'unique:parts,part_number,{{resourceId}}'),
Text::make('Name')
->sortable()
->rules('required'),
Textarea::make('Description')
->hideFromIndex()
->alwaysShow(),
Currency::make('Cost')
->sortable()
->rules('required', 'numeric', 'min:0'),
Number::make('Quantity In Stock')
->sortable()
->rules('required', 'numeric', 'min:0'),
Number::make('Reorder Level')
->sortable()
->rules('required', 'numeric', 'min:0'),
Text::make('Location')
->hideFromIndex(),
Text::make('Manufacturer')
->hideFromIndex(),
BelongsToMany::make('Repair Orders'),
];
}
public function cards(NovaRequest $request)
{
return [
new PartsInventoryValue,
];
}
public function lenses(NovaRequest $request)
{
return [
new LowInventoryParts,
];
}
public function actions(NovaRequest $request)
{
return [
new OrderParts,
];
}
}

171
app/Nova/RepairOrder.php Normal file
View File

@ -0,0 +1,171 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class RepairOrder extends Resource
{
public static string $model = \App\Models\RepairOrder::class;
public static $title = 'order_number';
public static $search = ['order_number', 'issue_description', 'diagnosis', 'resolution'];
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Text::make('Order Number')
->sortable()
->rules('required')
->creationRules('unique:repair_orders,order_number')
->updateRules('unique:repair_orders,order_number,{{resourceId}}'),
BelongsTo::make('Vehicle')
->searchable()
->rules('required'),
Badge::make('Status')
->map([
'pending' => 'info',
'in_progress' => 'warning',
'parts_ordered' => 'info',
'on_hold' => 'danger',
'completed' => 'success',
'cancelled' => 'danger',
])
->sortable(),
Badge::make('Priority')
->map([
'low' => 'info',
'medium' => 'warning',
'high' => 'danger',
'critical' => 'danger',
])
->sortable(),
DateTime::make('Reported At')
->sortable()
->rules('required'),
DateTime::make('Assigned At')
->sortable()
->hideFromIndex()
->nullable(),
DateTime::make('Started At')
->sortable()
->hideFromIndex()
->nullable(),
DateTime::make('Completed At')
->sortable()
->nullable(),
Textarea::make('Issue Description')
->rules('required')
->alwaysShow(),
Textarea::make('Diagnosis')
->hideFromIndex()
->alwaysShow()
->nullable(),
Textarea::make('Resolution')
->hideFromIndex()
->alwaysShow()
->nullable(),
Number::make('Mileage At Repair')
->rules('required', 'numeric', 'min:0'),
Number::make('Labor Hours')
->rules('nullable', 'numeric', 'min:0')
->hideFromIndex(),
Currency::make('Labor Cost')
->rules('nullable', 'numeric', 'min:0'),
Currency::make('Parts Cost')
->rules('nullable', 'numeric', 'min:0'),
Currency::make('Total Cost')
->rules('nullable', 'numeric', 'min:0')
->sortable(),
BelongsToMany::make('Technicians')
->fields(function () {
return [
Boolean::make('Is Lead'),
];
}),
BelongsToMany::make('Parts')
->fields(function () {
return [
Number::make('Quantity Used')
->rules('required', 'min:1'),
Currency::make('Unit Cost')
->rules('required'),
];
}),
HasMany::make('Repair Tasks'),
MorphMany::make('Documents'),
];
}
public function cards(NovaRequest $request)
{
return [
new RepairsPerMonth,
new AverageRepairCost,
];
}
public function filters(NovaRequest $request)
{
return [
new RepairStatusFilter,
];
}
public function actions(NovaRequest $request)
{
return [
new AssignTechnicians,
new CompleteRepair,
new GenerateRepairReport,
];
}
}

88
app/Nova/RepairTask.php Normal file
View File

@ -0,0 +1,88 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class RepairTask extends Resource
{
public static string $model = \App\Models\RepairTask::class;
public static $title = 'name';
public static $search = ['name', 'description'];
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
BelongsTo::make('Repair Order')
->searchable()
->rules('required'),
Text::make('Name')
->sortable()
->rules('required'),
Textarea::make('Description')
->hideFromIndex()
->nullable(),
Select::make('Status')
->options([
'pending' => 'Pending',
'in_progress' => 'In Progress',
'completed' => 'Completed',
'skipped' => 'Skipped',
])
->displayUsingLabels()
->sortable(),
BelongsTo::make('Technician')
->searchable()
->nullable(),
Number::make('Estimated Hours')
->step(0.1)
->nullable(),
Number::make('Actual Hours')
->step(0.1)
->nullable(),
DateTime::make('Started At')
->nullable(),
DateTime::make('Completed At')
->nullable(),
];
}
}

45
app/Nova/Resource.php Normal file
View File

@ -0,0 +1,45 @@
<?php
namespace App\Nova;
use Illuminate\Contracts\Database\Eloquent\Builder;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Resource as NovaResource;
use Laravel\Scout\Builder as ScoutBuilder;
abstract class Resource extends NovaResource
{
/**
* Build an "index" query for the given resource.
*/
public static function indexQuery(NovaRequest $request, Builder $query): Builder
{
return $query;
}
/**
* Build a Scout search query for the given resource.
*/
public static function scoutQuery(NovaRequest $request, ScoutBuilder $query): ScoutBuilder
{
return $query;
}
/**
* Build a "detail" query for the given resource.
*/
public static function detailQuery(NovaRequest $request, Builder $query): Builder
{
return parent::detailQuery($request, $query);
}
/**
* Build a "relatable" query for the given resource.
*
* This query determines which instances of the model may be attached to other resources.
*/
public static function relatableQuery(NovaRequest $request, Builder $query): Builder
{
return parent::relatableQuery($request, $query);
}
}

87
app/Nova/Technician.php Normal file
View File

@ -0,0 +1,87 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class Technician extends Resource
{
public static $model = \App\Models\Technician::class;
public static $title = 'name';
public static $search = ['name', 'employee_id', 'email'];
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
Text::make('Name')
->sortable()
->rules('required'),
Text::make('Employee ID')
->sortable()
->rules('required', 'unique:technicians,employee_id,{{resourceId}}'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'unique:technicians,email,{{resourceId}}'),
Text::make('Phone')
->hideFromIndex()
->rules('nullable'),
Select::make('Specialization')
->options([
'mechanical' => 'Mechanical',
'electrical' => 'Electrical',
'body' => 'Body Work',
'general' => 'General',
])
->displayUsingLabels()
->sortable(),
Boolean::make('Is Active')
->sortable(),
BelongsToMany::make('Repair Orders'),
HasMany::make('Repair Tasks'),
];
}
public function filters(NovaRequest $request)
{
return [
new TechnicianSpecializationFilter,
];
}
}

108
app/Nova/User.php Normal file
View File

@ -0,0 +1,108 @@
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Auth\PasswordValidationRules;
use Laravel\Nova\Fields\Gravatar;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Password;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
class User extends Resource
{
use PasswordValidationRules;
/**
* The model the resource corresponds to.
*
* @var class-string<\App\Models\User>
*/
public static $model = \App\Models\User::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'name';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'name', 'email',
];
/**
* Get the fields displayed by the resource.
*
* @return array<int, \Laravel\Nova\Fields\Field|\Laravel\Nova\Panel|\Laravel\Nova\ResourceTool|\Illuminate\Http\Resources\MergeValue>
*/
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Gravatar::make()->maxWidth(50),
Text::make('Name')
->sortable()
->rules('required', 'max:255'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Password::make('Password')
->onlyOnForms()
->creationRules($this->passwordRules())
->updateRules($this->optionalPasswordRules()),
];
}
/**
* Get the cards available for the request.
*
* @return array<int, \Laravel\Nova\Card>
*/
public function cards(NovaRequest $request): array
{
return [];
}
/**
* Get the filters available for the resource.
*
* @return array<int, \Laravel\Nova\Filters\Filter>
*/
public function filters(NovaRequest $request): array
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @return array<int, \Laravel\Nova\Lenses\Lens>
*/
public function lenses(NovaRequest $request): array
{
return [];
}
/**
* Get the actions available for the resource.
*
* @return array<int, \Laravel\Nova\Actions\Action>
*/
public function actions(NovaRequest $request): array
{
return [];
}
}

119
app/Nova/Vehicle.php Normal file
View File

@ -0,0 +1,119 @@
<?php
namespace App\Nova;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Fields\Number;
use Laravel\Nova\Fields\Select;
use Laravel\Nova\Fields\Textarea;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\Date;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\BelongsTo;
use Laravel\Nova\Fields\BelongsToMany;
use Laravel\Nova\Fields\HasMany;
use Laravel\Nova\Fields\Currency;
use Laravel\Nova\Fields\Badge;
use Laravel\Nova\Fields\File;
use Laravel\Nova\Fields\MorphMany;
use Laravel\Nova\Http\Requests\NovaRequest;
use App\Nova\Metrics\VehiclesPerStatus;
use App\Nova\Metrics\RepairsPerMonth;
use App\Nova\Metrics\AverageRepairCost;
use App\Nova\Metrics\PartsInventoryValue;
use App\Nova\Actions\GenerateRepairReport;
use App\Nova\Actions\CompleteRepair;
use App\Nova\Actions\AssignTechnicians;
use App\Nova\Actions\OrderParts;
use App\Nova\Filters\VehicleStatusFilter;
use App\Nova\Filters\RepairStatusFilter;
use App\Nova\Filters\TechnicianSpecializationFilter;
use App\Nova\Lenses\VehiclesDueForMaintenance;
use App\Nova\Lenses\LowInventoryParts;
class Vehicle extends Resource
{
public static string $model = \App\Models\Vehicle::class;
public static $title = 'fleet_number';
public static $search = ['fleet_number', 'license_plate', 'vin', 'make', 'model'];
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Text::make('Fleet Number')
->sortable()
->rules('required', 'unique:vehicles,fleet_number,{{resourceId}}'),
Text::make('License Plate')
->sortable(),
Text::make('Make')
->sortable()
->rules('required'),
Text::make('Model')
->sortable()
->rules('required'),
Number::make('Year')
->sortable()
->rules('required', 'digits:4'),
Text::make('VIN')
->hideFromIndex()
->rules('required', 'size:17', 'unique:vehicles,vin,{{resourceId}}'),
Text::make('Color')
->hideFromIndex(),
Number::make('Mileage')
->sortable()
->rules('required', 'numeric', 'min:0'),
Badge::make('Status')
->map([
'active' => 'success',
'in_repair' => 'warning',
'out_of_service' => 'danger',
])
->sortable(),
Textarea::make('Notes')
->alwaysShow()
->hideFromIndex(),
HasMany::make('Repair Orders'),
HasMany::make('Maintenance Schedules'),
MorphMany::make('Documents'),
];
}
public function cards(NovaRequest $request): array
{
return [
new VehiclesPerStatus,
];
}
public function filters(NovaRequest $request): array
{
return [
new VehicleStatusFilter,
];
}
public function lenses(NovaRequest $request): array
{
return [
new VehiclesDueForMaintenance,
];
}
public function actions(NovaRequest $request): array
{
return [];
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace App\Observers;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use App\Models\Part;
use App\Models\MaintenanceSchedule;
use Carbon\Carbon;
use Illuminate\Support\Str;
class PartObserver
{
/**
* Handle the Part "creating" event.
*/
public function creating(Part $part): void
{
// Generate part number if not provided
if (empty($part->part_number)) {
$prefix = 'P-';
$partName = Str::slug(substr($part->name, 0, 3));
$latest = Part::where('part_number', 'like', $prefix . $partName . '%')
->orderBy('part_number', 'desc')
->first();
$number = 1;
if ($latest) {
$parts = explode('-', $latest->part_number);
$number = intval(end($parts)) + 1;
}
$part->part_number = $prefix . $partName . '-' . str_pad($number, 4, '0', STR_PAD_LEFT);
}
}
/**
* Handle the Part "updated" event.
*/
public function updated(Part $part): void
{
// If stock drops below reorder level, could trigger notifications
if ($part->isDirty('quantity_in_stock') && $part->quantity_in_stock <= $part->reorder_level) {
// Notification logic could go here
}
}
}

View File

@ -0,0 +1,79 @@
<?php
namespace App\Observers;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use App\Models\Part;
use App\Models\MaintenanceSchedule;
use Carbon\Carbon;
use Illuminate\Support\Str;
class RepairOrderObserver
{
/**
* Handle the RepairOrder "creating" event.
*/
public function creating(RepairOrder $repairOrder): void
{
// Generate unique order number if not provided
if (empty($repairOrder->order_number)) {
$prefix = 'RO-' . date('Ymd');
$latest = RepairOrder::where('order_number', 'like', $prefix . '%')
->orderBy('order_number', 'desc')
->first();
$number = 1;
if ($latest) {
$parts = explode('-', $latest->order_number);
$number = intval(end($parts)) + 1;
}
$repairOrder->order_number = $prefix . '-' . str_pad($number, 4, '0', STR_PAD_LEFT);
}
// Set reported date if not provided
if (empty($repairOrder->reported_at)) {
$repairOrder->reported_at = Carbon::now();
}
}
/**
* Handle the RepairOrder "created" event.
*/
public function created(RepairOrder $repairOrder)
{
// Update vehicle status when a repair is created
$vehicle = Vehicle::find($repairOrder->vehicle_id);
if ($vehicle) {
$vehicle->status = 'in_repair';
$vehicle->save();
}
}
/**
* Handle the RepairOrder "updated" event.
*/
public function updated(RepairOrder $repairOrder)
{
// If status changed to completed, update the vehicle
if ($repairOrder->status === 'completed' && $repairOrder->getOriginal('status') !== 'completed') {
$vehicle = Vehicle::find($repairOrder->vehicle_id);
if ($vehicle) {
$vehicle->status = 'active';
$vehicle->save();
}
}
// If status changed to in_progress, set started_at
if ($repairOrder->status === 'in_progress' && $repairOrder->getOriginal('status') !== 'in_progress' && !$repairOrder->started_at) {
$repairOrder->started_at = Carbon::now();
$repairOrder->saveQuietly(); // Prevent recursion
}
// Recalculate costs when parts or labor changes
if ($repairOrder->isDirty(['labor_hours', 'parts_cost'])) {
$repairOrder->calculateCosts();
}
}
}

View File

@ -0,0 +1,120 @@
<?php
namespace App\Observers;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use App\Models\Part;
use App\Models\MaintenanceSchedule;
use Carbon\Carbon;
use Illuminate\Support\Str;
class VehicleObserver
{
/**
* Handle the Vehicle "creating" event.
*/
public function creating(Vehicle $vehicle): void
{
// Generate fleet number if not provided
if (empty($vehicle->fleet_number)) {
$prefix = 'FL-';
$latest = Vehicle::where('fleet_number', 'like', $prefix . '%')
->orderBy('fleet_number', 'desc')
->first();
$number = 1;
if ($latest) {
$parts = explode('-', $latest->fleet_number);
$number = intval(end($parts)) + 1;
}
$vehicle->fleet_number = $prefix . str_pad($number, 4, '0', STR_PAD_LEFT);
}
}
/**
* Handle the Vehicle "created" event.
*/
public function created(Vehicle $vehicle): void
{
// Create default maintenance schedules
$this->createDefaultMaintenanceSchedules($vehicle);
}
/**
* Handle the Vehicle "updated" event.
*/
public function updated(Vehicle $vehicle)
{
// If mileage updated, check maintenance schedules
if ($vehicle->isDirty('mileage')) {
$this->checkMaintenanceSchedules($vehicle);
}
}
/**
* Create default maintenance schedules for a new vehicle.
*/
protected function createDefaultMaintenanceSchedules(Vehicle $vehicle)
{
// Oil change schedule (every 5,000 miles or 6 months)
MaintenanceSchedule::create([
'vehicle_id' => $vehicle->id,
'name' => 'Oil Change',
'description' => 'Regular oil and filter change',
'mileage_interval' => 5000,
'day_interval' => 180,
'last_performed' => null,
'last_mileage' => $vehicle->mileage,
'next_due_mileage' => $vehicle->mileage + 5000,
'next_due_date' => Carbon::now()->addDays(180),
'is_active' => true,
]);
// Tire rotation (every 10,000 miles)
MaintenanceSchedule::create([
'vehicle_id' => $vehicle->id,
'name' => 'Tire Rotation',
'description' => 'Rotate tires to ensure even wear',
'mileage_interval' => 10000,
'day_interval' => null,
'last_performed' => null,
'last_mileage' => $vehicle->mileage,
'next_due_mileage' => $vehicle->mileage + 10000,
'next_due_date' => null,
'is_active' => true,
]);
// Full service (every 30,000 miles or yearly)
MaintenanceSchedule::create([
'vehicle_id' => $vehicle->id,
'name' => 'Full Service',
'description' => 'Complete vehicle inspection and service',
'mileage_interval' => 30000,
'day_interval' => 365,
'last_performed' => null,
'last_mileage' => $vehicle->mileage,
'next_due_mileage' => $vehicle->mileage + 30000,
'next_due_date' => Carbon::now()->addDays(365),
'is_active' => true,
]);
}
/**
* Check and update maintenance schedules.
*/
protected function checkMaintenanceSchedules(Vehicle $vehicle)
{
$schedules = MaintenanceSchedule::where('vehicle_id', $vehicle->id)
->where('is_active', true)
->get();
foreach ($schedules as $schedule) {
// If current mileage exceeds next due mileage, flag for maintenance
if ($schedule->next_due_mileage && $vehicle->mileage >= $schedule->next_due_mileage) {
// Could trigger notifications here
}
}
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}

View File

@ -0,0 +1,95 @@
<?php
namespace App\Providers;
use App\Models\User;
use Illuminate\Support\Facades\Gate;
use Laravel\Fortify\Features;
use Laravel\Nova\Nova;
use Laravel\Nova\NovaApplicationServiceProvider;
class NovaServiceProvider extends NovaApplicationServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot(): void
{
parent::boot();
//
}
/**
* Register the configurations for Laravel Fortify.
*/
protected function fortify(): void
{
Nova::fortify()
->features([
Features::updatePasswords(),
// Features::emailVerification(),
// Features::twoFactorAuthentication(['confirm' => true, 'confirmPassword' => true]),
])
->register();
}
/**
* Register the Nova routes.
*/
protected function routes(): void
{
Nova::routes()
->withAuthenticationRoutes(default: true)
->withPasswordResetRoutes()
->withoutEmailVerificationRoutes()
->register();
}
/**
* Register the Nova gate.
*
* This gate determines who can access Nova in non-local environments.
*/
protected function gate(): void
{
Gate::define('viewNova', function (User $user) {
return in_array($user->email, [
//
]);
});
}
/**
* Get the dashboards that should be listed in the Nova sidebar.
*
* @return array<int, \Laravel\Nova\Dashboard>
*/
protected function dashboards(): array
{
return [
new \App\Nova\Dashboards\Main,
new \App\Nova\Dashboards\WorkshopDashboard,
];
}
/**
* Get the tools that should be listed in the Nova sidebar.
*
* @return array<int, \Laravel\Nova\Tool>
*/
public function tools(): array
{
return [];
}
/**
* Register any application services.
*/
public function register(): void
{
parent::register();
//
}
}

View File

@ -0,0 +1,80 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Laravel\Nova\Nova;
use Laravel\Nova\Menu\MenuItem;
use Laravel\Nova\Menu\MenuSection;
use App\Nova\Dashboards\WorkshopDashboard;
use App\Models\RepairOrder;
use App\Models\Vehicle;
use App\Models\Part;
use App\Observers\RepairOrderObserver;
use App\Observers\VehicleObserver;
use App\Observers\PartObserver;
class WorkshopServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
// Register workshop config
$this->mergeConfigFrom(
__DIR__ . '/../../config/workshop.php', 'workshop'
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// Register observers
RepairOrder::observe(RepairOrderObserver::class);
Vehicle::observe(VehicleObserver::class);
Part::observe(PartObserver::class);
// Publish config
$this->publishes([
__DIR__ . '/../../config/workshop.php' => config_path('workshop.php'),
], 'workshop-config');
// Configure Nova menu
Nova::mainMenu(function () {
return [
MenuSection::dashboard(WorkshopDashboard::class)->icon('chart-bar'),
MenuSection::make('Fleet Management', [
MenuItem::resource('App\Nova\Vehicle'),
MenuItem::resource('App\Nova\MaintenanceSchedule'),
MenuItem::link('Vehicles Due Maintenance', '/resources/vehicles/lens/vehicles-due-for-maintenance'),
])->icon('truck')->collapsable(),
MenuSection::make('Repairs', [
MenuItem::resource('App\Nova\RepairOrder'),
MenuItem::resource('App\Nova\RepairTask'),
])->icon('wrench')->collapsable(),
MenuSection::make('Inventory', [
MenuItem::resource('App\Nova\Part'),
MenuItem::link('Low Stock Parts', '/resources/parts/lens/low-inventory-parts'),
])->icon('archive')->collapsable(),
MenuSection::make('Staff', [
MenuItem::resource('App\Nova\Technician'),
])->icon('user-group')->collapsable(),
MenuSection::make('Documents', [
MenuItem::resource('App\Nova\Document'),
])->icon('document-text')->collapsable(),
];
});
}
}

18
artisan Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env php
<?php
use Illuminate\Foundation\Application;
use Symfony\Component\Console\Input\ArgvInput;
define('LARAVEL_START', microtime(true));
// Register the Composer autoloader...
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);
exit($status);

18
bootstrap/app.php Normal file
View File

@ -0,0 +1,18 @@
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
//
})
->withExceptions(function (Exceptions $exceptions) {
//
})->create();

2
bootstrap/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

7
bootstrap/providers.php Normal file
View File

@ -0,0 +1,7 @@
<?php
return [
App\Providers\AppServiceProvider::class,
App\Providers\NovaServiceProvider::class,
App\Providers\WorkshopServiceProvider::class,
];

83
composer.json Normal file
View File

@ -0,0 +1,83 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "laravel/laravel",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"repositories": [
{
"type": "path",
"url": "./nova",
"options": {
"symlink": false
}
}
],
"require": {
"php": "^8.2",
"barryvdh/laravel-dompdf": "^3.1",
"laravel/framework": "^11.0",
"laravel/nova": "*",
"laravel/tinker": "^2.10.1"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2",
"laravel/pint": "^1.13",
"laravel/sail": "^1.41",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"phpunit/phpunit": "^11.5.3"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi",
"@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
"@php artisan migrate --graceful --ansi"
],
"dev": [
"Composer\\Config::disableProcessTimeout",
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}

9347
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

126
config/app.php Normal file
View File

@ -0,0 +1,126 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application, which will be used when the
| framework needs to place the application's name in a notification or
| other UI elements where an application name needs to be displayed.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| the application so that it's available within Artisan commands.
|
*/
'url' => env('APP_URL', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. The timezone
| is set to "UTC" by default as it is suitable for most use cases.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by Laravel's translation / localization methods. This option can be
| set to any locale for which you plan to have translation strings.
|
*/
'locale' => env('APP_LOCALE', 'en'),
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is utilized by Laravel's encryption services and should be set
| to a random, 32 character string to ensure that all encrypted values
| are secure. You should do this prior to deploying the application.
|
*/
'cipher' => 'AES-256-CBC',
'key' => env('APP_KEY'),
'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
),
],
/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/
'maintenance' => [
'driver' => env('APP_MAINTENANCE_DRIVER', 'file'),
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
];

115
config/auth.php Normal file
View File

@ -0,0 +1,115 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option defines the default authentication "guard" and password
| reset "broker" for your application. You may change these values
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => env('AUTH_GUARD', 'web'),
'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| which utilizes session storage plus the Eloquent user provider.
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| Supported: "session"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication guards have a user provider, which defines how the
| users are actually retrieved out of your database or other storage
| system used by the application. Typically, Eloquent is utilized.
|
| If you have multiple user tables or models you may configure multiple
| providers to represent the model / table. These providers may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => env('AUTH_MODEL', App\Models\User::class),
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| These configuration options specify the behavior of Laravel's password
| reset functionality, including the table utilized for token storage
| and the user provider that is invoked to actually retrieve users.
|
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'),
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| window expires and users are asked to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800),
];

108
config/cache.php Normal file
View File

@ -0,0 +1,108 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache store that will be used by the
| framework. This connection is utilized if another isn't explicitly
| specified when running a cache operation inside the application.
|
*/
'default' => env('CACHE_STORE', 'database'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| 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 types of items stored in your caches.
|
| Supported drivers: "array", "database", "file", "memcached",
| "redis", "dynamodb", "octane", "null"
|
*/
'stores' => [
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'connection' => env('DB_CACHE_CONNECTION'),
'table' => env('DB_CACHE_TABLE', 'cache'),
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
'octane' => [
'driver' => 'octane',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing the APC, database, memcached, Redis, and DynamoDB cache
| stores, there might be other applications using the same cache. For
| that reason, you may prefix every cache key to avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];

174
config/database.php Normal file
View File

@ -0,0 +1,174 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for database operations. This is
| the connection which will be utilized unless another connection
| is explicitly specified when you execute a query / statement.
|
*/
'default' => env('DB_CONNECTION', 'sqlite'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Below are all of the database connections defined for your application.
| An example configuration is provided for each database system which
| is supported by Laravel. You're free to add / remove connections.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'mariadb' => [
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run on the database.
|
*/
'migrations' => [
'table' => 'migrations',
'update_date_on_publish' => true,
],
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as Memcached. You may define your connection settings here.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
'persistent' => env('REDIS_PERSISTENT', false),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],
];

80
config/filesystems.php Normal file
View File

@ -0,0 +1,80 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application for file storage.
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Below you may configure as many filesystem disks as necessary, and you
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
'serve' => true,
'throw' => false,
'report' => false,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => false,
'report' => false,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
'report' => false,
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];

132
config/logging.php Normal file
View File

@ -0,0 +1,132 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that is utilized to write
| messages to your logs. The value provided here should match one of
| the channels present in the list of "channels" configured below.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Deprecations Log Channel
|--------------------------------------------------------------------------
|
| This option controls the log channel that should be used to log warnings
| regarding deprecated PHP and library features. This allows you to get
| your application ready for upcoming major versions of dependencies.
|
*/
'deprecations' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => env('LOG_DEPRECATIONS_TRACE', false),
],
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Laravel
| utilizes the Monolog PHP logging library, which includes a variety
| of powerful log handlers and formatters that you're free to use.
|
| Available drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => explode(',', env('LOG_STACK', 'single')),
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => env('LOG_DAILY_DAYS', 14),
'replace_placeholders' => true,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'),
'emoji' => env('LOG_SLACK_EMOJI', ':boom:'),
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'handler_with' => [
'stream' => 'php://stderr',
],
'formatter' => env('LOG_STDERR_FORMATTER'),
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER),
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

116
config/mail.php Normal file
View File

@ -0,0 +1,116 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send all email
| messages unless another mailer is explicitly specified when sending
| the message. All additional mailers can be configured within the
| "mailers" array. Examples of each type of mailer are provided.
|
*/
'default' => env('MAIL_MAILER', 'log'),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers that can be used
| when delivering an email. You may specify which one you're using for
| your mailers below. You may also add additional mailers if needed.
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "resend", "log", "array",
| "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'scheme' => env('MAIL_SCHEME'),
'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', '127.0.0.1'),
'port' => env('MAIL_PORT', 2525),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
],
'ses' => [
'transport' => 'ses',
],
'postmark' => [
'transport' => 'postmark',
// 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'),
// 'client' => [
// 'timeout' => 5,
// ],
],
'resend' => [
'transport' => 'resend',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
'failover' => [
'transport' => 'failover',
'mailers' => [
'smtp',
'log',
],
],
'roundrobin' => [
'transport' => 'roundrobin',
'mailers' => [
'ses',
'postmark',
],
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all emails sent by your application to be sent from
| the same address. Here you may specify a name and address that is
| used globally for all emails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
];

208
config/nova.php Normal file
View File

@ -0,0 +1,208 @@
<?php
use Laravel\Nova\Actions\ActionResource;
use Laravel\Nova\Http\Middleware\Authenticate;
use Laravel\Nova\Http\Middleware\Authorize;
use Laravel\Nova\Http\Middleware\BootTools;
use Laravel\Nova\Http\Middleware\DispatchServingNovaEvent;
// use Laravel\Nova\Http\Middleware\EnsureEmailIsVerified;
use Laravel\Nova\Http\Middleware\HandleInertiaRequests;
return [
/*
|--------------------------------------------------------------------------
| Nova License Key
|--------------------------------------------------------------------------
|
| The following configuration option contains your Nova license key. On
| non-local domains, Nova will verify that the Nova installation has
| a valid license associated with the application's active domain.
|
*/
'license_key' => env('NOVA_LICENSE_KEY'),
/*
|--------------------------------------------------------------------------
| Nova App Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to display the name of the application within the UI
| or in other locations. Of course, you're free to change the value.
|
*/
'name' => env('NOVA_APP_NAME', env('APP_NAME')),
/*
|--------------------------------------------------------------------------
| Nova Domain Name
|--------------------------------------------------------------------------
|
| This value is the "domain name" associated with your application. This
| can be used to prevent Nova's internal routes from being registered
| on subdomains which do not need access to your admin application.
|
*/
'domain' => env('NOVA_DOMAIN_NAME', null),
/*
|--------------------------------------------------------------------------
| Nova Path
|--------------------------------------------------------------------------
|
| This is the URI path where Nova will be accessible from. Feel free to
| change this path to anything you like. Note that this URI will not
| affect Nova's internal API routes which aren't exposed to users.
|
*/
'path' => '/nova',
/*
|--------------------------------------------------------------------------
| Nova Authentication Guard
|--------------------------------------------------------------------------
|
| This configuration option defines the authentication guard that will
| be used to protect your Nova routes. This option should match one
| of the authentication guards defined in the "auth" config file.
|
*/
'guard' => env('NOVA_GUARD', null),
/*
|--------------------------------------------------------------------------
| Nova Password Reset Broker
|--------------------------------------------------------------------------
|
| This configuration option defines the password broker that will be
| used when passwords are reset. This option should mirror one of
| the password reset options defined in the "auth" config file.
|
*/
'passwords' => env('NOVA_PASSWORDS', null),
/*
|--------------------------------------------------------------------------
| Nova Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every Nova route, giving you the
| chance to add your own middleware to this stack or override any of
| the existing middleware. Or, you can just stick with this stack.
|
*/
'middleware' => [
'web',
HandleInertiaRequests::class,
DispatchServingNovaEvent::class,
BootTools::class,
],
'api_middleware' => [
'nova',
Authenticate::class,
// EnsureEmailIsVerified::class,
Authorize::class,
],
/*
|--------------------------------------------------------------------------
| Nova Pagination Type
|--------------------------------------------------------------------------
|
| This option defines the visual style used in Nova's resource pagination
| views. You may select between "simple", "load-more", and "links" for
| your applications. Feel free to adjust this option to your choice.
|
*/
'pagination' => 'simple',
/*
|--------------------------------------------------------------------------
| Nova Storage Disk
|--------------------------------------------------------------------------
|
| This configuration option allows you to define the default disk that
| will be used to store files using the Image, File, and other file
| related field types. You're welcome to use any configured disk.
|
*/
'storage_disk' => env('NOVA_STORAGE_DISK', 'public'),
/*
|--------------------------------------------------------------------------
| Nova Currency
|--------------------------------------------------------------------------
|
| This configuration option allows you to define the default currency
| used by the Currency field within Nova. You may change this to a
| valid ISO 4217 currency code to suit your application's needs.
|
*/
'currency' => 'USD',
/*
|--------------------------------------------------------------------------
| Branding
|--------------------------------------------------------------------------
|
| These configuration values allow you to customize the branding of the
| Nova interface, including the primary color and the logo that will
| be displayed within the Nova interface. This logo value must be
| the absolute path to an SVG logo within the local filesystem.
|
*/
// 'brand' => [
// 'logo' => resource_path('/img/example-logo.svg'),
// 'colors' => [
// "400" => "24, 182, 155, 0.5",
// "500" => "24, 182, 155",
// "600" => "24, 182, 155, 0.75",
// ]
// ],
/*
|--------------------------------------------------------------------------
| Nova Action Resource Class
|--------------------------------------------------------------------------
|
| This configuration option allows you to specify a custom resource class
| to use for action log entries instead of the default that ships with
| Nova, thus allowing for the addition of additional UI form fields.
|
*/
'actions' => [
'resource' => ActionResource::class,
],
/*
|--------------------------------------------------------------------------
| Nova Impersonation Redirection URLs
|--------------------------------------------------------------------------
|
| This configuration option allows you to specify a URL where Nova should
| redirect an administrator after impersonating another user and a URL
| to redirect the administrator after stopping impersonating a user.
|
*/
'impersonation' => [
'started' => '/',
'stopped' => '/',
],
];

112
config/queue.php Normal file
View File

@ -0,0 +1,112 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue supports a variety of backends via a single, unified
| API, giving you convenient access to each backend using identical
| syntax for each. The default queue connection is defined below.
|
*/
'default' => env('QUEUE_CONNECTION', 'database'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection options for every queue backend
| used by your application. An example configuration is provided for
| each backend supported by Laravel. You're also free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'connection' => env('DB_QUEUE_CONNECTION'),
'table' => env('DB_QUEUE_TABLE', 'jobs'),
'queue' => env('DB_QUEUE', 'default'),
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
'after_commit' => false,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
'queue' => env('BEANSTALKD_QUEUE', 'default'),
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
'block_for' => 0,
'after_commit' => false,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false,
],
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
],
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control how and where failed jobs are stored. Laravel ships with
| support for storing failed jobs in a simple file or in a database.
|
| Supported drivers: "database-uuids", "dynamodb", "file", "null"
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
],
];

38
config/services.php Normal file
View File

@ -0,0 +1,38 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'resend' => [
'key' => env('RESEND_KEY'),
],
'slack' => [
'notifications' => [
'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),
'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),
],
],
];

217
config/session.php Normal file
View File

@ -0,0 +1,217 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option determines the default session driver that is utilized for
| incoming requests. Laravel supports a variety of storage options to
| persist session data. Database storage is a great default choice.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'database'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to expire immediately when the browser is closed then you may
| indicate that via the expire_on_close configuration option.
|
*/
'lifetime' => (int) env('SESSION_LIFETIME', 120),
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it's stored. All encryption is performed
| automatically by Laravel and you may use the session like normal.
|
*/
'encrypt' => env('SESSION_ENCRYPT', false),
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When utilizing the "file" session driver, the session files are placed
| on disk. The default storage location is defined here; however, you
| are free to provide another location where they should be stored.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table to
| be used to store sessions. Of course, a sensible default is defined
| for you; however, you're welcome to change this to another table.
|
*/
'table' => env('SESSION_TABLE', 'sessions'),
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using one of the framework's cache driven session backends, you may
| define the cache store which should be used to store the session data
| between requests. This must match one of your defined cache stores.
|
| Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the session cookie that is created by
| the framework. Typically, you should not need to change this value
| since doing so does not grant a meaningful security improvement.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application, but you're free to change this when necessary.
|
*/
'path' => env('SESSION_PATH', '/'),
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| This value determines the domain and subdomains the session cookie is
| available to. By default, the cookie will be available to the root
| domain and all subdomains. Typically, this shouldn't be changed.
|
*/
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you when it can't be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. It's unlikely you should disable this option.
|
*/
'http_only' => env('SESSION_HTTP_ONLY', true),
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| will set this value to "lax" to permit secure cross-site requests.
|
| See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value
|
| Supported: "lax", "strict", "none", null
|
*/
'same_site' => env('SESSION_SAME_SITE', 'lax'),
/*
|--------------------------------------------------------------------------
| Partitioned Cookies
|--------------------------------------------------------------------------
|
| Setting this value to true will tie the cookie to the top-level site for
| a cross-site context. Partitioned cookies are accepted by the browser
| when flagged "secure" and the Same-Site attribute is set to "none".
|
*/
'partitioned' => env('SESSION_PARTITIONED_COOKIE', false),
];

83
config/workshop.php Normal file
View File

@ -0,0 +1,83 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Workshop Settings
|--------------------------------------------------------------------------
|
| These settings control various aspects of the workshop management system.
|
*/
// Default labor rate per hour
'hourly_rate' => env('WORKSHOP_HOURLY_RATE', 85.00),
// Tax rate for parts and services
'tax_rate' => env('WORKSHOP_TAX_RATE', 0.0725),
// Default markup percentage for parts
'parts_markup' => env('WORKSHOP_PARTS_MARKUP', 0.30),
// Workshop operating hours
'operating_hours' => [
'monday' => ['08:00', '17:00'],
'tuesday' => ['08:00', '17:00'],
'wednesday' => ['08:00', '17:00'],
'thursday' => ['08:00', '17:00'],
'friday' => ['08:00', '17:00'],
'saturday' => ['09:00', '14:00'],
'sunday' => null, // Closed
],
// Maintenance schedule defaults
'maintenance_schedules' => [
'oil_change' => [
'name' => 'Oil Change',
'mileage_interval' => 5000,
'day_interval' => 180,
],
'tire_rotation' => [
'name' => 'Tire Rotation',
'mileage_interval' => 10000,
],
'full_service' => [
'name' => 'Full Service',
'mileage_interval' => 30000,
'day_interval' => 365,
],
],
// Default repair order statuses
'repair_statuses' => [
'pending' => 'Pending',
'in_progress' => 'In Progress',
'parts_ordered' => 'Parts Ordered',
'on_hold' => 'On Hold',
'completed' => 'Completed',
'cancelled' => 'Cancelled',
],
// Priority levels
'priorities' => [
'low' => 'Low',
'medium' => 'Medium',
'high' => 'High',
'critical' => 'Critical',
],
// Vehicle status options
'vehicle_statuses' => [
'active' => 'Active',
'in_repair' => 'In Repair',
'out_of_service' => 'Out of Service',
],
// Technician specializations
'specializations' => [
'mechanical' => 'Mechanical',
'electrical' => 'Electrical',
'body' => 'Body Work',
'general' => 'General',
],
];

1
database/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.sqlite*

View File

@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*/
public function unverified(): static
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@ -0,0 +1,49 @@
<?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('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
};

View File

@ -0,0 +1,35 @@
<?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('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->integer('expiration');
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};

View File

@ -0,0 +1,57 @@
<?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('jobs', function (Blueprint $table) {
$table->id();
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->longText('failed_job_ids');
$table->mediumText('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};

View File

@ -0,0 +1,42 @@
<?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::table('users', function (Blueprint $table) {
$table->text('two_factor_secret')
->after('password')
->nullable();
$table->text('two_factor_recovery_codes')
->after('two_factor_secret')
->nullable();
$table->timestamp('two_factor_confirmed_at')
->after('two_factor_recovery_codes')
->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn([
'two_factor_secret',
'two_factor_recovery_codes',
'two_factor_confirmed_at',
]);
});
}
};

View File

@ -0,0 +1,153 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
// Vehicles table
Schema::create('vehicles', function (Blueprint $table) {
$table->id();
$table->string('fleet_number')->unique();
$table->string('license_plate')->nullable();
$table->string('make');
$table->string('model');
$table->year('year');
$table->string('vin', 17)->unique();
$table->string('color')->nullable();
$table->integer('mileage')->default(0);
$table->enum('status', ['active', 'in_repair', 'out_of_service'])->default('active');
$table->text('notes')->nullable();
$table->timestamps();
$table->softDeletes();
});
// Technicians table
Schema::create('technicians', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('employee_id')->unique();
$table->string('email')->unique();
$table->string('phone')->nullable();
$table->enum('specialization', ['mechanical', 'electrical', 'body', 'general'])->default('general');
$table->boolean('is_active')->default(true);
$table->timestamps();
$table->softDeletes();
});
// Parts inventory table
Schema::create('parts', function (Blueprint $table) {
$table->id();
$table->string('part_number')->unique();
$table->string('name');
$table->text('description')->nullable();
$table->decimal('cost', 10, 2);
$table->integer('quantity_in_stock')->default(0);
$table->integer('reorder_level')->default(5);
$table->string('location')->nullable();
$table->string('manufacturer')->nullable();
$table->timestamps();
});
// Repair orders table
Schema::create('repair_orders', function (Blueprint $table) {
$table->id();
$table->string('order_number')->unique();
$table->foreignId('vehicle_id')->constrained();
$table->enum('priority', ['low', 'medium', 'high', 'critical'])->default('medium');
$table->enum('status', ['pending', 'in_progress', 'parts_ordered', 'on_hold', 'completed', 'cancelled'])->default('pending');
$table->timestamp('reported_at');
$table->timestamp('assigned_at')->nullable();
$table->timestamp('started_at')->nullable();
$table->timestamp('completed_at')->nullable();
$table->text('issue_description');
$table->text('diagnosis')->nullable();
$table->text('resolution')->nullable();
$table->integer('mileage_at_repair');
$table->decimal('labor_hours', 5, 2)->default(0);
$table->decimal('labor_cost', 10, 2)->default(0);
$table->decimal('parts_cost', 10, 2)->default(0);
$table->decimal('total_cost', 10, 2)->default(0);
$table->timestamps();
$table->softDeletes();
});
// Repair tasks table
Schema::create('repair_tasks', function (Blueprint $table) {
$table->id();
$table->foreignId('repair_order_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->text('description')->nullable();
$table->enum('status', ['pending', 'in_progress', 'completed', 'skipped'])->default('pending');
$table->foreignId('technician_id')->nullable()->constrained();
$table->decimal('estimated_hours', 5, 2)->nullable();
$table->decimal('actual_hours', 5, 2)->nullable();
$table->timestamp('started_at')->nullable();
$table->timestamp('completed_at')->nullable();
$table->timestamps();
});
// Parts used in repair
Schema::create('part_repair_order', function (Blueprint $table) {
$table->id();
$table->foreignId('repair_order_id')->constrained()->cascadeOnDelete();
$table->foreignId('part_id')->constrained();
$table->integer('quantity_used');
$table->decimal('unit_cost', 10, 2);
$table->timestamps();
});
// Technicians assigned to repair orders
Schema::create('repair_order_technician', function (Blueprint $table) {
$table->id();
$table->foreignId('repair_order_id')->constrained()->cascadeOnDelete();
$table->foreignId('technician_id')->constrained();
$table->boolean('is_lead')->default(false);
$table->timestamps();
});
// Maintenance schedules
Schema::create('maintenance_schedules', function (Blueprint $table) {
$table->id();
$table->foreignId('vehicle_id')->constrained();
$table->string('name');
$table->text('description')->nullable();
$table->integer('mileage_interval')->nullable();
$table->integer('day_interval')->nullable();
$table->date('last_performed')->nullable();
$table->integer('last_mileage')->nullable();
$table->date('next_due_date')->nullable();
$table->integer('next_due_mileage')->nullable();
$table->boolean('is_active')->default(true);
$table->timestamps();
});
// Document storage for invoices, pictures, manuals
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->morphs('documentable');
$table->string('name');
$table->string('file_path');
$table->string('file_type');
$table->integer('file_size');
$table->string('uploaded_by')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('documents');
Schema::dropIfExists('maintenance_schedules');
Schema::dropIfExists('repair_order_technician');
Schema::dropIfExists('part_repair_order');
Schema::dropIfExists('repair_tasks');
Schema::dropIfExists('repair_orders');
Schema::dropIfExists('parts');
Schema::dropIfExists('technicians');
Schema::dropIfExists('vehicles');
}
};

View File

@ -0,0 +1,23 @@
<?php
namespace Database\Seeders;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
}

492
lang/vendor/nova/en.json vendored Normal file
View File

@ -0,0 +1,492 @@
{
"Actions": "Actions",
"Details": "Details",
"If you did not request a password reset, no further action is required.": "If you did not request a password reset, no further action is required.",
"Reset Password": "Reset Password",
"Sorry! You are not authorized to perform this action.": "Sorry! You are not authorized to perform this action.",
"You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account.",
"Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.": "Before continuing, could you verify your email address by clicking on the link we just emailed to you? If you didn't receive the email, we will gladly send you another.",
"A new verification link has been sent to the email address you provided in your profile settings.": "A new verification link has been sent to the email address you provided in your profile settings.",
"This is a secure area of the application. Please confirm your password before continuing.": "This is a secure area of the application. Please confirm your password before continuing.",
"Error": "Error",
"Current Password": "Current Password",
"Confirm Password": "Confirm Password",
"We have emailed your password reset link!": "We have emailed your password reset link!",
"Dashboard": "Dashboard",
"Email Address": "Email Address",
"Username": "Username",
"Forgot Password": "Forgot Password",
"Forgot your password?": "Forgot your password?",
"Log In": "Log In",
"Logout": "Logout",
"Password": "Password",
"Remember me": "Remember me",
"Email Verification": "Email Verification",
"Secure Area": "Secure Area",
"Resources": "Resources",
"Send Password Reset Link": "Send Password Reset Link",
"Welcome Back!": "Welcome Back!",
"Delete Resource": "Delete Resource",
"Delete": "Delete",
"Soft Deleted": "Soft Deleted",
"Detach Resource": "Detach Resource",
"Detach": "Detach",
"Detach Selected": "Detach Selected",
"Delete Selected": "Delete Selected",
"Force Delete Selected": "Force Delete Selected",
"Restore Selected": "Restore Selected",
"Restore Resource": "Restore Resource",
"Restore": "Restore",
"Force Delete Resource": "Force Delete Resource",
"Force Delete": "Force Delete",
"Confirm": "Confirm",
"Are you sure you want to delete this resource?": "Are you sure you want to delete this resource?",
"Are you sure you want to delete the selected resources?": "Are you sure you want to delete the selected resources?",
"Are you sure you want to detach this resource?": "Are you sure you want to detach this resource?",
"Are you sure you want to detach the selected resources?": "Are you sure you want to detach the selected resources?",
"Are you sure you want to force delete this resource?": "Are you sure you want to force delete this resource?",
"Are you sure you want to force delete the selected resources?": "Are you sure you want to force delete the selected resources?",
"Are you sure you want to restore this resource?": "Are you sure you want to restore this resource?",
"Are you sure you want to restore the selected resources?": "Are you sure you want to restore the selected resources?",
"Are you sure you want to remove this item?": "Are you sure you want to remove this item?",
"No :resource matched the given criteria.": "No :resource matched the given criteria.",
"Failed to load :resource!": "Failed to load :resource!",
"Another user has updated this resource since this page was loaded. Please refresh the page and try again.": "Another user has updated this resource since this page was loaded. Please refresh the page and try again.",
"Are you sure you want to delete this file?": "Are you sure you want to delete this file?",
"Are you sure you want to run this action?": "Are you sure you want to run this action?",
"Attach": "Attach",
"Attach & Attach Another": "Attach & Attach Another",
"Close": "Close",
"Cancel": "Cancel",
"Choose": "Choose",
"Choose File": "Choose File",
"Choose Files": "Choose Files",
"Drop file or click to choose": "Drop file or click to choose",
"Drop files or click to choose": "Drop files or click to choose",
"Choose Type": "Choose Type",
"Choose an option": "Choose an option",
"Click to choose": "Click to choose",
"Reset Filters": "Reset Filters",
"Create": "Create",
"Create & Add Another": "Create & Add Another",
"Delete File": "Delete File",
"Edit": "Edit",
"Edit Attached": "Edit Attached",
"Go Home": "Go Home",
"Hold Up!": "Hold Up!",
"Lens": "Lens",
"New": "New",
"Next": "Next",
"Only Trashed": "Only Trashed",
"Per Page": "Per Page",
"Preview": "Preview",
"Previous": "Previous",
"No Data": "No Data",
"No Current Data": "No Current Data",
"No Prior Data": "No Prior Data",
"No Increase": "No Increase",
"No Results Found.": "No Results Found.",
"Standalone Actions": "Standalone Actions",
"Run Action": "Run Action",
"Select Action": "Select Action",
"Search": "Search",
"Press / to search": "Press / to search",
"Select All Dropdown": "Select All Dropdown",
"Select all": "Select all",
"Select this page": "Select this page",
"Something went wrong.": "Something went wrong.",
"The action was executed successfully.": "The action was executed successfully.",
"The government won't let us show you what's behind these doors": "The government won't let us show you what's behind these doors",
"Update": "Update",
"Update & Continue Editing": "Update & Continue Editing",
"View": "View",
"We're lost in space. The page you were trying to view does not exist.": "We're lost in space. The page you were trying to view does not exist.",
"Show Content": "Show Content",
"Hide Content": "Hide Content",
"Whoops": "Whoops",
"Whoops!": "Whoops!",
"With Trashed": "With Trashed",
"Trashed": "Trashed",
"Write": "Write",
"total": "total",
"January": "January",
"February": "February",
"March": "March",
"April": "April",
"May": "May",
"June": "June",
"July": "July",
"August": "August",
"September": "September",
"October": "October",
"November": "November",
"December": "December",
"Afghanistan": "Afghanistan",
"Aland Islands": "Åland Islands",
"Albania": "Albania",
"Algeria": "Algeria",
"American Samoa": "American Samoa",
"Andorra": "Andorra",
"Angola": "Angola",
"Anguilla": "Anguilla",
"Antarctica": "Antarctica",
"Antigua And Barbuda": "Antigua and Barbuda",
"Argentina": "Argentina",
"Armenia": "Armenia",
"Aruba": "Aruba",
"Australia": "Australia",
"Austria": "Austria",
"Azerbaijan": "Azerbaijan",
"Bahamas": "Bahamas",
"Bahrain": "Bahrain",
"Bangladesh": "Bangladesh",
"Barbados": "Barbados",
"Belarus": "Belarus",
"Belgium": "Belgium",
"Belize": "Belize",
"Benin": "Benin",
"Bermuda": "Bermuda",
"Bhutan": "Bhutan",
"Bolivia": "Bolivia",
"Bonaire, Sint Eustatius and Saba": "Bonaire, Sint Eustatius and Saba",
"Bosnia And Herzegovina": "Bosnia and Herzegovina",
"Botswana": "Botswana",
"Bouvet Island": "Bouvet Island",
"Brazil": "Brazil",
"British Indian Ocean Territory": "British Indian Ocean Territory",
"Brunei Darussalam": "Brunei",
"Bulgaria": "Bulgaria",
"Burkina Faso": "Burkina Faso",
"Burundi": "Burundi",
"Cambodia": "Cambodia",
"Cameroon": "Cameroon",
"Canada": "Canada",
"Cape Verde": "Cape Verde",
"Cayman Islands": "Cayman Islands",
"Central African Republic": "Central African Republic",
"Chad": "Chad",
"Chile": "Chile",
"China": "China",
"Christmas Island": "Christmas Island",
"Cocos (Keeling) Islands": "Cocos (Keeling) Islands",
"Colombia": "Colombia",
"Comoros": "Comoros",
"Congo": "Congo",
"Congo, Democratic Republic": "Congo, Democratic Republic",
"Cook Islands": "Cook Islands",
"Costa Rica": "Costa Rica",
"Cote D'Ivoire": "Côte d'Ivoire",
"Croatia": "Croatia",
"Cuba": "Cuba",
"Curaçao": "Curaçao",
"Cyprus": "Cyprus",
"Czech Republic": "Czechia",
"Denmark": "Denmark",
"Djibouti": "Djibouti",
"Dominica": "Dominica",
"Dominican Republic": "Dominican Republic",
"Ecuador": "Ecuador",
"Egypt": "Egypt",
"El Salvador": "El Salvador",
"Equatorial Guinea": "Equatorial Guinea",
"Eritrea": "Eritrea",
"Estonia": "Estonia",
"Ethiopia": "Ethiopia",
"Falkland Islands (Malvinas)": "Falkland Islands (Malvinas)",
"Faroe Islands": "Faroe Islands",
"Fiji": "Fiji",
"Finland": "Finland",
"France": "France",
"French Guiana": "French Guiana",
"French Polynesia": "French Polynesia",
"French Southern Territories": "French Southern Territories",
"Gabon": "Gabon",
"Gambia": "Gambia",
"Georgia": "Georgia",
"Germany": "Germany",
"Ghana": "Ghana",
"Gibraltar": "Gibraltar",
"Greece": "Greece",
"Greenland": "Greenland",
"Grenada": "Grenada",
"Guadeloupe": "Guadeloupe",
"Guam": "Guam",
"Guatemala": "Guatemala",
"Guernsey": "Guernsey",
"Guinea": "Guinea",
"Guinea-Bissau": "Guinea-Bissau",
"Guyana": "Guyana",
"Haiti": "Haiti",
"Heard Island & Mcdonald Islands": "Heard Island and McDonald Islands",
"Holy See (Vatican City State)": "Vatican City",
"Honduras": "Honduras",
"Hong Kong": "Hong Kong",
"Hungary": "Hungary",
"Iceland": "Iceland",
"India": "India",
"Indonesia": "Indonesia",
"Iran, Islamic Republic Of": "Iran",
"Iraq": "Iraq",
"Ireland": "Ireland",
"Isle Of Man": "Isle of Man",
"Israel": "Israel",
"Italy": "Italy",
"Jamaica": "Jamaica",
"Japan": "Japan",
"Jersey": "Jersey",
"Jordan": "Jordan",
"Kazakhstan": "Kazakhstan",
"Kenya": "Kenya",
"Kiribati": "Kiribati",
"Korea, Democratic People's Republic of": "North Korea",
"Korea": "South Korea",
"Kosovo": "Kosovo",
"Kuwait": "Kuwait",
"Kyrgyzstan": "Kyrgyzstan",
"Lao People's Democratic Republic": "Laos",
"Latvia": "Latvia",
"Lebanon": "Lebanon",
"Lesotho": "Lesotho",
"Liberia": "Liberia",
"Libyan Arab Jamahiriya": "Libya",
"Liechtenstein": "Liechtenstein",
"Lithuania": "Lithuania",
"Luxembourg": "Luxembourg",
"Macao": "Macao",
"Macedonia": "North Macedonia",
"Madagascar": "Madagascar",
"Malawi": "Malawi",
"Malaysia": "Malaysia",
"Maldives": "Maldives",
"Mali": "Mali",
"Malta": "Malta",
"Marshall Islands": "Marshall Islands",
"Martinique": "Martinique",
"Mauritania": "Mauritania",
"Mauritius": "Mauritius",
"Mayotte": "Mayotte",
"Mexico": "Mexico",
"Micronesia, Federated States Of": "Micronesia",
"Moldova": "Moldova",
"Monaco": "Monaco",
"Mongolia": "Mongolia",
"Montenegro": "Montenegro",
"Montserrat": "Montserrat",
"Morocco": "Morocco",
"Mozambique": "Mozambique",
"Myanmar": "Myanmar",
"Namibia": "Namibia",
"Nauru": "Nauru",
"Nepal": "Nepal",
"Netherlands": "Netherlands",
"New Caledonia": "New Caledonia",
"New Zealand": "New Zealand",
"Nicaragua": "Nicaragua",
"Niger": "Niger",
"Nigeria": "Nigeria",
"Niue": "Niue",
"Norfolk Island": "Norfolk Island",
"Northern Mariana Islands": "Northern Mariana Islands",
"Norway": "Norway",
"Oman": "Oman",
"Pakistan": "Pakistan",
"Palau": "Palau",
"Palestinian Territory, Occupied": "Palestinian Territories",
"Panama": "Panama",
"Papua New Guinea": "Papua New Guinea",
"Paraguay": "Paraguay",
"Peru": "Peru",
"Philippines": "Philippines",
"Pitcairn": "Pitcairn Islands",
"Poland": "Poland",
"Portugal": "Portugal",
"Puerto Rico": "Puerto Rico",
"Qatar": "Qatar",
"Reunion": "Réunion",
"Romania": "Romania",
"Russian Federation": "Russia",
"Rwanda": "Rwanda",
"Saint Barthelemy": "St. Barthélemy",
"Saint Helena": "St. Helena",
"Saint Kitts And Nevis": "St. Kitts and Nevis",
"Saint Lucia": "St. Lucia",
"Saint Martin": "St. Martin",
"Saint Pierre And Miquelon": "St. Pierre and Miquelon",
"Saint Vincent And Grenadines": "St. Vincent and Grenadines",
"Samoa": "Samoa",
"San Marino": "San Marino",
"Sao Tome And Principe": "São Tomé and Príncipe",
"Saudi Arabia": "Saudi Arabia",
"Senegal": "Senegal",
"Serbia": "Serbia",
"Seychelles": "Seychelles",
"Sierra Leone": "Sierra Leone",
"Singapore": "Singapore",
"Sint Maarten (Dutch part)": "Sint Maarten",
"Slovakia": "Slovakia",
"Slovenia": "Slovenia",
"Solomon Islands": "Solomon Islands",
"Somalia": "Somalia",
"South Africa": "South Africa",
"South Georgia And Sandwich Isl.": "South Georgia and South Sandwich Islands",
"South Sudan": "South Sudan",
"Spain": "Spain",
"Sri Lanka": "Sri Lanka",
"Sudan": "Sudan",
"Suriname": "Suriname",
"Svalbard And Jan Mayen": "Svalbard and Jan Mayen",
"Swaziland": "Eswatini",
"Sweden": "Sweden",
"Switzerland": "Switzerland",
"Syrian Arab Republic": "Syria",
"Taiwan": "Taiwan",
"Tajikistan": "Tajikistan",
"Tanzania": "Tanzania",
"Thailand": "Thailand",
"Timor-Leste": "Timor-Leste",
"Togo": "Togo",
"Tokelau": "Tokelau",
"Tonga": "Tonga",
"Trinidad And Tobago": "Trinidad and Tobago",
"Tunisia": "Tunisia",
"Turkey": "Türkiye",
"Turkmenistan": "Turkmenistan",
"Turks And Caicos Islands": "Turks and Caicos Islands",
"Tuvalu": "Tuvalu",
"Uganda": "Uganda",
"Ukraine": "Ukraine",
"United Arab Emirates": "United Arab Emirates",
"United Kingdom": "United Kingdom",
"United States": "United States",
"United States Outlying Islands": "U.S. Outlying Islands",
"Uruguay": "Uruguay",
"Uzbekistan": "Uzbekistan",
"Vanuatu": "Vanuatu",
"Venezuela": "Venezuela",
"Viet Nam": "Vietnam",
"Virgin Islands, British": "British Virgin Islands",
"Virgin Islands, U.S.": "U.S. Virgin Islands",
"Wallis And Futuna": "Wallis and Futuna",
"Western Sahara": "Western Sahara",
"Yemen": "Yemen",
"Zambia": "Zambia",
"Zimbabwe": "Zimbabwe",
"Yes": "Yes",
"No": "No",
"Action Name": "Name",
"Action Initiated By": "Initiated By",
"Action Target": "Target",
"Action Status": "Status",
"Action Happened At": "Happened At",
"resource": "resource",
"resources": "resources",
"Choose date": "Choose date",
"The :resource was created!": "The :resource was created!",
"The resource was attached!": "The resource was attached!",
"The :resource was updated!": "The :resource was updated!",
"The resource was updated!": "The resource was updated!",
"The :resource was deleted!": "The :resource was deleted!",
"The :resource was restored!": "The :resource was restored!",
"Increase": "Increase",
"Constant": "Constant",
"Decrease": "Decrease",
"Reset Password Notification": "Reset Password Notification",
"Nova User": "Nova User",
"of": "of",
"no file selected": "no file selected",
"Sorry, your session has expired.": "Sorry, your session has expired.",
"Reload": "Reload",
"Key": "Key",
"Value": "Value",
"Add row": "Add row",
"Attach :resource": "Attach :resource",
"Create :resource": "Create :resource",
"Choose :resource": "Choose :resource",
"New :resource": "New :resource",
"Edit :resource": "Edit :resource",
"Update :resource": "Update :resource",
"Add :resource": "Add :resource",
"Start Polling": "Start Polling",
"Stop Polling": "Stop Polling",
"Choose :field": "Choose :field",
"Download": "Download",
"Action": "Action",
"Changes": "Changes",
"Original": "Original",
"This resource no longer exists": "This resource no longer exists",
"The resource was prevented from being saved!": "The resource was prevented from being saved!",
":resource Details": ":resource Details",
"There are no available options for this resource.": "There are no available options for this resource.",
"All resources loaded.": "All resources loaded.",
"Load :perPage More": "Load :perPage More",
":amount selected": ":amount selected",
":amount Total": ":amount Total",
"Show All Fields": "Show All Fields",
"There was a problem submitting the form.": "There was a problem submitting the form.",
"There was a problem executing the action.": "There was a problem executing the action.",
"There was a problem fetching the resource.": "There was a problem fetching the resource.",
"Do you really want to leave? You have unsaved changes.": "Do you really want to leave? You have unsaved changes.",
"*": "*",
"—": "—",
"The file was deleted!": "The file was deleted!",
"This file field is read-only.": "This file field is read-only.",
"No additional information...": "No additional information...",
"ID": "ID",
"30 Days": "30 Days",
"60 Days": "60 Days",
"90 Days": "90 Days",
"Today": "Today",
"Month To Date": "Month To Date",
"Quarter To Date": "Quarter To Date",
"Year To Date": "Year To Date",
"Customize": "Customize",
"Update :resource: :title": "Update :resource: :title",
"Update attached :resource: :title": "Update attached :resource: :title",
":resource Details: :title": ":resource Details: :title",
"The HasOne relationship has already been filled.": "The HasOne relationship has already been filled.",
"An error occurred while uploading the file.": "An error occurred while uploading the file.",
"An error occurred while uploading the file: :error": "An error occurred while uploading the file: :error",
"Previewing": "Previewing",
"Replicate": "Replicate",
"Are you sure you want to log out?": "Are you sure you want to log out?",
"There are no new notifications.": "There are no new notifications.",
"Resource Row Dropdown": "Resource Row Dropdown",
"This copy of Nova is unlicensed.": "This copy of Nova is unlicensed.",
"Impersonate": "Impersonate",
"Stop Impersonating": "Stop Impersonating",
"Are you sure you want to stop impersonating?": "Are you sure you want to stop impersonating?",
"Light": "Light",
"Dark": "Dark",
"System": "System",
"From": "From",
"To": "To",
"There are no fields to display.": "There are no fields to display.",
"Notifications": "Notifications",
"Mark all as Read": "Mark all as read",
"Delete all notifications": "Delete all notifications",
"Are you sure you want to delete all the notifications?": "Are you sure you want to delete all the notifications?",
"Mark Read": "Mark Read",
"Mark Unread": "Mark Unread",
"Copy to clipboard": "Copy to clipboard",
"Are you sure you want to delete this notification?": "Are you sure you want to delete this notification?",
"The image could not be loaded": "The image could not be loaded",
"The selected resources have been :action!": "The selected resources have been :action!",
"Are you sure you want to mark all notifications as read?": "Are you sure you want to mark all notifications as read?",
"Mark all notifications as read": "Mark all notifications as read",
"OK": "OK",
"Delete Notification": "Delete Notification",
"Export As CSV": "Export As CSV",
"Filename": "Filename",
"Type": "Type",
"CSV (.csv)": "CSV (.csv)",
"Excel (.xlsx)": "Excel (.xlsx)",
"Attach files by dragging & dropping, selecting or pasting them.": "Attach files by dragging & dropping, selecting or pasting them.",
"Uploading files... (:current/:total)": "Uploading files... (:current/:total)",
"Remove": "Remove",
"Uploading": "Uploading",
"The image could not be loaded.": "The image could not be loaded.",
"Action Events": "Action Events",
"Action Event": "Action Event",
"User Actions": "User Actions",
"User Security": "User Security"
}

19
lang/vendor/nova/en/validation.php vendored Normal file
View File

@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
'attached' => 'This :attribute is already attached.',
'relatable' => 'This :attribute may not be associated with this resource.',
];

28
nova/.eslintrc Normal file
View File

@ -0,0 +1,28 @@
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
};

3
nova/babel.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
}

166
nova/composer.json Normal file
View File

@ -0,0 +1,166 @@
{
"name": "laravel/nova",
"description": "A wonderful administration interface for Laravel.",
"keywords": [
"laravel",
"admin"
],
"license": "MIT",
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"require": {
"php": "^8.1",
"ext-json": "*",
"brick/money": "^0.8|^0.9|^0.10",
"illuminate/filesystem": "^10.48.23|^11.35",
"illuminate/support": "^10.48.23|^11.35",
"inertiajs/inertia-laravel": "^1.3.2|^2.0",
"laravel/fortify": "^1.25.2",
"nesbot/carbon": "^2.62.1|^3.4",
"rap2hpoutre/fast-excel": "^5.4",
"spatie/once": "^3.0",
"symfony/console": "^6.4.14|^7.0.3",
"symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/finder": "^6.4.13|^7.0.3",
"symfony/polyfill-intl-icu": "^1.31",
"symfony/polyfill-php83": "^1.31",
"symfony/polyfill-php84": "^1.31",
"symfony/process": "^6.4.14|^7.0.3"
},
"require-dev": {
"doctrine/dbal": "^3.5.1|^4.0",
"larastan/larastan": "^2.5.1",
"laravel/pint": "^1.17",
"laravel/scout": "^10.11",
"orchestra/testbench-core": "^8.30|^9.7",
"orchestra/testbench-dusk": "^8.32|^9.10",
"orchestra/workbench": "^8.13|^9.9",
"phpstan/phpstan": "^1.12",
"phpunit/phpunit": "^10.5.35|^11.3.5",
"predis/predis": "^2.3",
"spatie/laravel-ray": "^1.39"
},
"autoload": {
"psr-4": {
"Laravel\\Nova\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Laravel\\Nova\\Tests\\": "tests/",
"App\\": "workbench/app/",
"Database\\Factories\\": "workbench/database/factories/",
"Database\\Seeders\\": "workbench/database/seeders/",
"NovaComponents\\CustomField\\": "workbench/nova-components/CustomField/src/",
"NovaComponents\\IconsViewer\\": "workbench/nova-components/IconsViewer/src/",
"NovaComponents\\RememberTokenCopier\\": "workbench/nova-components/RememberTokenCopier/src/",
"NovaComponents\\ResourceTool\\": "workbench/nova-components/ResourceTool/src/",
"NovaComponents\\SidebarTool\\": "workbench/nova-components/SidebarTool/src/",
"Testbench\\App\\": "tests/laravel/app/",
"Testbench\\Database\\Factories\\": "tests/laravel/database/factories/"
},
"files": [
"workbench/app/functions.php"
]
},
"extra": {
"branch-alias": {
"dev-main": "5.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Nova\\NovaCoreServiceProvider"
],
"aliases": {
"Nova": "Laravel\\Nova\\Nova"
}
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"php-http/discovery": true
},
"preferred-install": {
"laravel/nova-dusk-suite": "source",
"*": "auto"
},
"sort-packages": true
},
"scripts": {
"post-update-cmd": [
"@php vendor/bin/dusk-updater detect --auto-update --ansi",
"@dusk:prepare",
"@sync"
],
"clear": [
"@php vendor/bin/testbench-dusk package:purge-skeleton --ansi",
"@php vendor/bin/testbench-dusk package:dusk-purge --ansi"
],
"build:dev-assets": [
"TAILWIND_MODE=build npm run dev",
"@sync"
],
"build:assets": [
"TAILWIND_MODE=build npm run prod",
"@sync"
],
"sync": [
"@php vendor/bin/testbench-dusk package:sync-skeleton --ansi",
"@php vendor/bin/testbench-dusk package:discover --ansi",
"@php vendor/bin/testbench-dusk nova:publish --force --ansi"
],
"dusk:prepare": [
"@clear",
"@php vendor/bin/testbench workbench:drop-sqlite-db --ansi",
"@php -r \"file_exists('phpunit.dusk.xml') || copy('phpunit.dusk.xml.dist', 'phpunit.dusk.xml'); \"",
"@php vendor/bin/testbench-dusk package:dusk-purge --ansi",
"@php vendor/bin/testbench-dusk workbench:build --ansi"
],
"test": [
"@clear",
"@php vendor/bin/testbench workbench:drop-sqlite-db --ansi",
"@php vendor/bin/testbench workbench:build --ansi",
"@php vendor/bin/phpunit"
],
"dusk:test": [
"@dusk:prepare",
"@php vendor/bin/phpunit -c phpunit.dusk.xml --stop-on-failure --stop-on-error"
],
"test:local": [
"@dusk:prepare",
"@php vendor/bin/phpunit --group date-field,datetime-field,external-network --testdox",
"@php vendor/bin/phpunit -c phpunit.dusk.xml --group date-field,datetime-field,external-network --testdox"
],
"lint": [
"@php vendor/bin/pint src --config=pint.json",
"@php vendor/bin/pint workbench --config=pint.json",
"@php vendor/bin/pint tests --config=tests/pint.json",
"@php vendor/bin/pint types --config=tests/pint.json",
"@php vendor/bin/phpstan analyse --verbose"
],
"serve": [
"@clear",
"@php vendor/bin/testbench-dusk package:discover --ansi",
"@php vendor/bin/testbench-dusk workbench:build --ansi",
"@putenv PHP_CLI_SERVER_WORKERS=5",
"@php vendor/bin/testbench-dusk serve --ansi"
],
"herd": [
"@clear",
"@sync",
"@php vendor/bin/testbench-dusk workbench:build --ansi",
"APP_URL=http://laravel-nova.test herd open laravel-nova"
]
},
"suggest": {
"ext-intl": "Required to format Currency field"
},
"minimum-stability": "dev",
"prefer-stable": true,
"version": "5.1.5"
}

208
nova/config/nova.php Normal file
View File

@ -0,0 +1,208 @@
<?php
use Laravel\Nova\Actions\ActionResource;
use Laravel\Nova\Http\Middleware\Authenticate;
use Laravel\Nova\Http\Middleware\Authorize;
use Laravel\Nova\Http\Middleware\BootTools;
use Laravel\Nova\Http\Middleware\DispatchServingNovaEvent;
// use Laravel\Nova\Http\Middleware\EnsureEmailIsVerified;
use Laravel\Nova\Http\Middleware\HandleInertiaRequests;
return [
/*
|--------------------------------------------------------------------------
| Nova License Key
|--------------------------------------------------------------------------
|
| The following configuration option contains your Nova license key. On
| non-local domains, Nova will verify that the Nova installation has
| a valid license associated with the application's active domain.
|
*/
'license_key' => env('NOVA_LICENSE_KEY'),
/*
|--------------------------------------------------------------------------
| Nova App Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to display the name of the application within the UI
| or in other locations. Of course, you're free to change the value.
|
*/
'name' => env('NOVA_APP_NAME', env('APP_NAME')),
/*
|--------------------------------------------------------------------------
| Nova Domain Name
|--------------------------------------------------------------------------
|
| This value is the "domain name" associated with your application. This
| can be used to prevent Nova's internal routes from being registered
| on subdomains which do not need access to your admin application.
|
*/
'domain' => env('NOVA_DOMAIN_NAME', null),
/*
|--------------------------------------------------------------------------
| Nova Path
|--------------------------------------------------------------------------
|
| This is the URI path where Nova will be accessible from. Feel free to
| change this path to anything you like. Note that this URI will not
| affect Nova's internal API routes which aren't exposed to users.
|
*/
'path' => '/nova',
/*
|--------------------------------------------------------------------------
| Nova Authentication Guard
|--------------------------------------------------------------------------
|
| This configuration option defines the authentication guard that will
| be used to protect your Nova routes. This option should match one
| of the authentication guards defined in the "auth" config file.
|
*/
'guard' => env('NOVA_GUARD', null),
/*
|--------------------------------------------------------------------------
| Nova Password Reset Broker
|--------------------------------------------------------------------------
|
| This configuration option defines the password broker that will be
| used when passwords are reset. This option should mirror one of
| the password reset options defined in the "auth" config file.
|
*/
'passwords' => env('NOVA_PASSWORDS', null),
/*
|--------------------------------------------------------------------------
| Nova Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every Nova route, giving you the
| chance to add your own middleware to this stack or override any of
| the existing middleware. Or, you can just stick with this stack.
|
*/
'middleware' => [
'web',
HandleInertiaRequests::class,
DispatchServingNovaEvent::class,
BootTools::class,
],
'api_middleware' => [
'nova',
Authenticate::class,
// EnsureEmailIsVerified::class,
Authorize::class,
],
/*
|--------------------------------------------------------------------------
| Nova Pagination Type
|--------------------------------------------------------------------------
|
| This option defines the visual style used in Nova's resource pagination
| views. You may select between "simple", "load-more", and "links" for
| your applications. Feel free to adjust this option to your choice.
|
*/
'pagination' => 'simple',
/*
|--------------------------------------------------------------------------
| Nova Storage Disk
|--------------------------------------------------------------------------
|
| This configuration option allows you to define the default disk that
| will be used to store files using the Image, File, and other file
| related field types. You're welcome to use any configured disk.
|
*/
'storage_disk' => env('NOVA_STORAGE_DISK', 'public'),
/*
|--------------------------------------------------------------------------
| Nova Currency
|--------------------------------------------------------------------------
|
| This configuration option allows you to define the default currency
| used by the Currency field within Nova. You may change this to a
| valid ISO 4217 currency code to suit your application's needs.
|
*/
'currency' => 'USD',
/*
|--------------------------------------------------------------------------
| Branding
|--------------------------------------------------------------------------
|
| These configuration values allow you to customize the branding of the
| Nova interface, including the primary color and the logo that will
| be displayed within the Nova interface. This logo value must be
| the absolute path to an SVG logo within the local filesystem.
|
*/
// 'brand' => [
// 'logo' => resource_path('/img/example-logo.svg'),
// 'colors' => [
// "400" => "24, 182, 155, 0.5",
// "500" => "24, 182, 155",
// "600" => "24, 182, 155, 0.75",
// ]
// ],
/*
|--------------------------------------------------------------------------
| Nova Action Resource Class
|--------------------------------------------------------------------------
|
| This configuration option allows you to specify a custom resource class
| to use for action log entries instead of the default that ships with
| Nova, thus allowing for the addition of additional UI form fields.
|
*/
'actions' => [
'resource' => ActionResource::class,
],
/*
|--------------------------------------------------------------------------
| Nova Impersonation Redirection URLs
|--------------------------------------------------------------------------
|
| This configuration option allows you to specify a URL where Nova should
| redirect an administrator after impersonating another user and a URL
| to redirect the administrator after stopping impersonating a user.
|
*/
'impersonation' => [
'started' => '/',
'stopped' => '/',
],
];

View File

@ -0,0 +1,53 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
use Illuminate\Support\Facades\Schema;
use Laravel\Nova\Util;
class CreateActionEventsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('action_events', function (Blueprint $table) {
$table->id();
$table->char('batch_id', 36);
$table->foreignIdFor(Util::userModel(), 'user_id')->index();
$table->string('name');
$table->morphs('actionable');
$table->morphs('target');
$table->string('model_type');
if (Builder::$defaultMorphKeyType === 'uuid') {
$table->uuid('model_id')->nullable();
} elseif (Builder::$defaultMorphKeyType === 'ulid') {
$table->ulid('model_id')->nullable();
} else {
$table->unsignedBigInteger('model_id')->nullable();
}
$table->text('fields');
$table->string('status', 25)->default('running');
$table->text('exception');
$table->timestamps();
$table->index(['batch_id', 'model_type', 'model_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('action_events');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFieldsToActionEventsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('action_events', function (Blueprint $table) {
$table->mediumText('original')->nullable();
$table->mediumText('changes')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('action_events', function (Blueprint $table) {
$table->dropColumn('original', 'changes');
});
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateNovaNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('nova_notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('nova_notifications');
}
}

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddFieldsToNovaNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('nova_notifications', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropColumns('nova_notifications', ['deleted_at']);
}
}

View File

@ -0,0 +1,52 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFieldAttachmentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasTable('nova_pending_trix_attachments')) {
Schema::rename('nova_pending_trix_attachments', 'nova_pending_field_attachments');
} else {
Schema::create('nova_pending_field_attachments', function (Blueprint $table) {
$table->increments('id');
$table->string('draft_id')->index();
$table->string('attachment');
$table->string('disk');
$table->timestamps();
});
}
if (Schema::hasTable('nova_trix_attachments')) {
Schema::rename('nova_trix_attachments', 'nova_field_attachments');
} else {
Schema::create('nova_field_attachments', function (Blueprint $table) {
$table->increments('id');
$table->morphs('attachable');
$table->string('attachment');
$table->string('disk');
$table->string('url')->index();
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('nova_pending_field_attachments');
Schema::dropIfExists('nova_field_attachments');
}
}

70
nova/generators.js Normal file
View File

@ -0,0 +1,70 @@
const omit = require('lodash/omit')
const twColors = require('tailwindcss/colors')
const toRGBString = hexCode => {
if (hexCode.startsWith('#')) {
let hex = hexCode.replace('#', '')
if (hex.length === 3) {
hex = `${hex[0]}${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}`
}
const r = parseInt(hex.substring(0, 2), 16)
const g = parseInt(hex.substring(2, 4), 16)
const b = parseInt(hex.substring(4, 6), 16)
return `${r}, ${g}, ${b}`
}
return hexCode
}
const colors = { primary: twColors.sky, ...twColors, gray: twColors.slate }
const except = omit(colors, [
'lightBlue',
'warmGray',
'trueGray',
'coolGray',
'blueGray',
])
function generateRootCSSVars() {
return Object.fromEntries(
Object.entries(except)
.map(([key, value]) => {
if (typeof value === 'string') {
return [[`--colors-${key}`, toRGBString(value)]]
}
return Object.entries(value).map(([shade, color]) => {
return [`--colors-${key}-${shade}`, toRGBString(color)]
})
})
.flat(1)
)
}
function generateTailwindColors() {
return Object.fromEntries(
Object.entries(except).map(([key, value]) => {
if (typeof value === 'string') {
return [`${key}`, value]
}
return [
key,
Object.fromEntries(
Object.entries(value).map(([shade]) => {
return [`${shade}`, `rgba(var(--colors-${key}-${shade}))`]
})
),
]
})
)
}
module.exports = {
generateRootCSSVars,
generateTailwindColors,
}

32
nova/jest.config.js Normal file
View File

@ -0,0 +1,32 @@
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/en/configuration.html
*/
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// An array of file extensions your modules use
moduleFileExtensions: ['js', 'json', 'vue'],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
'@/(.*)': '<rootDir>/resources/js/$1',
},
// The test environment that will be used for testing
testEnvironment: 'node',
// The glob patterns Jest uses to detect test files
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],
// A map from regular expressions to paths to transformers
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.vue$': '@vue/vue3-jest',
},
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
transformIgnorePatterns: [],
}

18107
nova/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

78
nova/package.json Normal file
View File

@ -0,0 +1,78 @@
{
"name": "laravel-nova",
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production",
"test": "./node_modules/.bin/jest"
},
"devDependencies": {
"@babel/preset-env": "^7.25.4",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/typography": "^0.5.15",
"@types/lodash": "^4.17.7",
"@vue/babel-plugin-jsx": "^1.2.2",
"@vue/babel-preset-jsx": "^1.4.0",
"@vue/compiler-sfc": "^3.5.0",
"@vue/test-utils": "^2.4.6",
"@vue/vue3-jest": "^27.0.0",
"axios": "^1.7.4",
"babel-jest": "^27.5.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"cross-env": "^7.0.3",
"jest": "^27.5.1",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
"postcss": "^8.5.0",
"postcss-import": "^14.1.0",
"postcss-rtlcss": "^3.7.2",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.14",
"tailwindcss": "^3.4.10",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vue-loader": "^17.4.0"
},
"dependencies": {
"@floating-ui/vue": "^1.1.4",
"@headlessui/vue": "^1.7.22",
"@heroicons/vue": "^2.1.5",
"@inertiajs/vue3": "^2.0.2",
"@popperjs/core": "^2.11.8",
"@vue/compat": "^3.5.0",
"@vueuse/core": "^10.11.1",
"@vueuse/integrations": "^10.11.1",
"autosize": "^4.0.4",
"browser-sync": "^3.0.2",
"browser-sync-v3-webpack-plugin": "^0.1.0",
"chartist": "^1.3.0",
"chartist-plugin-tooltips-updated": "^1.0.0",
"codemirror": "^5.65.17",
"colortranslator": "^1.10.2",
"floating-vue": "^2.0.0",
"focus-trap": "^7.5.4",
"inflector-js": "^1.0.1",
"js-cookie": "^2.2.1",
"laravel-echo": "^1.16.1",
"laravel-vapor": "^0.7.1",
"luxon": "^1.28.1",
"mousetrap": "^1.6.5",
"numbro": "^2.5.0",
"pusher-js": "^7.6.0",
"slugify": "^1.6.6",
"tiny-emitter": "^2.1.0",
"toastedjs": "0.0.2",
"trix": "^2.1.12",
"uid": "^2.0.2",
"vue": "^3.5.0",
"vuex": "^4.1.0"
}
}

32
nova/prettier.config.js Normal file
View File

@ -0,0 +1,32 @@
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
semi: false,
requirePragma: false,
proseWrap: 'preserve',
arrowParens: 'avoid',
overrides: [
{
files: 'resources/css/**/*.css',
options: {
tabWidth: 2,
},
},
{
files: [
'resources/js/fields.js',
'resources/js/components.js',
'resources/js/router/routes.js',
],
options: {
printWidth: 300,
},
},
],
}

1
nova/public/app.css Normal file

File diff suppressed because one or more lines are too long

1
nova/public/app.css.map Normal file

File diff suppressed because one or more lines are too long

1
nova/public/app.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,46 @@
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/
/*!
* JavaScript Cookie v2.2.1
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/
/*!
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

1
nova/public/app.js.map Normal file

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More