Ahmed Ali
how to add extra breadcrumbs work
i visit all website and documentation and also youtube i search about how to add extra breadcrumbs in resource i find some method like getBreadcrumbs() function but when defind it in new page i don't no how to add the like to previous page please help to make the day good thanks
4 replies
Interviewer::query()
how to add some to this return to table
thsi my custom return collection
Interviewer::query()
->where('user_id', '=', auth()->user()->id)
->first()
->interviews->pluck('program') in title worked and in description not woking and return data as collection please help guys
2 replies
two column as unique
i have this form
return $form
->schema([
Forms\Components\Select::make('program_id')
->relationship('program', 'name')
->required(),
Forms\Components\Select::make('applicant_id')
->relationship('applicant', 'name')
->required(),
Forms\Components\TextInput::make('values')
->required(),
Forms\Components\Select::make('status_id')
->relationship('status', 'name')
->required(),
]);
i need program_id and applicant _id as unique in table at same time
11 replies
i have register auth page and i need to do action like
$user = Auth()->user();
$user->assignRole('admin');
in this page
class Register extends BaseRegister
{
protected function getForms(): array
{
return [
'form' => $this->form(
$this->makeForm()
->schema([
$this->getNameFormComponent(),
$this->getEmailFormComponent(),
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
])
->statePath('data'),
),
];
}
}
8 replies
i have model below and i run php artisan make:filament-resource Application --generat
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\Pivot;
class Application extends Pivot
{
use HasFactory;
/
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'program_id',
'applicant_id',
'status',
'values',
];
public $table = 'applications';
/
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'id' => 'integer',
'program_id' => 'integer',
'applicant_id' => 'integer',
'values' => 'array',
];
public function program(): BelongsTo
{
return $this->belongsTo(Program::class);
}
public function applicant(): BelongsTo
{
return $this->belongsTo(Applicant::class);
}
public function reviews(): HasMany
{
return $this->hasMany(Review::class);
}
public function reviewers(): BelongsToMany
{
return $this->belongsToMany(Reviewer::class, 'reviews')
->using(Review::class)
->as('review')
->withPivot('id', 'note', 'reviewer_id', 'application_id')
->withTimestamps();
}
}
will generate resource with columns and filters empty and with another model or pivot table work well what the problem ?
->columns([
//
])
->filters([
//
])
4 replies