shashika
image not show. please help
this code working on blade.
<img
src="{{ Storage::disk(config('filesystems.default'))->url(App\Enums\FilePath::DRIVER_PHOTO->value . Auth::user()->driver->photo) . '?timestamp=' . time() }}"
alt="Driver Photo"
class="object-cover w-20 h-20 rounded-full">
9 replies
How to override filament default form data store method
<?php
namespace App\Filament\Company\Resources\VehicleResource\Pages;
use App\Enums\Status;
use App\Filament\Company\Resources\VehicleResource;
use App\Models\Company;
use App\Models\VehicleCategory;
use App\Models\VehicleType;
use Filament\Resources\Pages\CreateRecord;
use Illuminate\Support\Facades\Auth;
use Localift\Vehicle\Actions\CreateVehicle as LocaliftCreateVehicle;
class CreateVehicle extends CreateRecord
{
protected static string $resource = VehicleResource::class;
public function __construct(
private LocaliftCreateVehicle $createVehicle
) {
}
protected function beforeCreate(): void
{
//dd($this->data['vehicle_category_id']);
$this->createVehicle->execute(
$this->data['name'],
Status::ACTIVE->toStatus(),
VehicleType::query()->find($this->data['vehicle_type_id'])->toVehicleType(),
VehicleCategory::query()->find($this->data['vehicle_category_id'])->toVehicleCategory(),
Company::query()->find(Auth::id())->toCompany(),
$this->data['name'],
);
}
}
14 replies
How to execute custom action written outside of filament?
For example I want store data in database using my custom action when my create function on my vehicle resource is executed without executing the default logic of filament for create function on resources.
Further, I need to achieve the above as I'm currently using domain driven development.
6 replies