crear resource web de laravel filament

crear resource web de laravel filament

  • crear resource web de laravel filament

    crear resource web de laravel filament

    crear resource web de laravel filament...

 //crear resource Web

php artisan make:filament-resource Web
 //editar WebResource

<?php

namespace App\Filament\Resources;

use App\Filament\Resources\WebResource\Pages;
use App\Filament\Resources\WebResource\RelationManagers;
use App\Models\Web;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\Resource;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;

class WebResource extends Resource
{
    protected static ?string $model = Web::class;

    protected static ?string $navigationIcon = 'heroicon-o-collection';

    public static function form(Form $form): Form
    {
        return $form
            ->schema([
				Forms\Components\FileUpload::make('img'),
                Forms\Components\TextInput::make('nom')
                    ->required()
                    ->maxLength(255),
                Forms\Components\TextInput::make('tipus')
                    ->maxLength(255),                
                
                Forms\Components\Select::make('framework')
                   ->options([
        'laravel' => 'laravel',
        'wordpress' => 'wordpress',
        'codeigniter' => 'codeigniter',
		'php' => 'php',
		]),
				Forms\Components\Select::make('css')
                     ->options([
        'bootstrap' => 'bootstrap',
        'tailwind' => 'tailwind',
        'uikit' => 'uikit',
		]),
		Forms\Components\Select::make('servidor')
                    ->options([
        'localhost' => 'localhost',
        'hostinger' => 'hostinger',
        'github' => 'github',
		'synology' => 'synology',
		]),
                Forms\Components\TextInput::make('url')
                    ->required()
                    ->maxLength(255),
                Forms\Components\TextInput::make('download')
                    ->maxLength(255),
            ]);
    }

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
			    Tables\Columns\ImageColumn::make('img')->width(35),
                Tables\Columns\TextColumn::make('nom')->limit(10)
				->searchable()
                ->sortable(),
                Tables\Columns\TextColumn::make('tipus')->limit(10)
				->searchable()
                ->sortable(),                
                Tables\Columns\TextColumn::make('framework')->limit(10)
				->searchable()
                ->sortable(),
				Tables\Columns\TextColumn::make('css')->limit(10)
				->searchable()
                ->sortable(),
				Tables\Columns\TextColumn::make('servidor')->limit(10)
				->searchable()
                ->sortable(),
                Tables\Columns\TextColumn::make('url')->limit(10),
                Tables\Columns\TextColumn::make('download')->limit(10),
                Tables\Columns\TextColumn::make('updated_at')
                    ->dateTime(),
                
            ])
            ->filters([
                //
            ])
            ->actions([
                Tables\Actions\EditAction::make(),
            ])
            ->bulkActions([
                Tables\Actions\DeleteBulkAction::make(),
            ]);
    }
    
    public static function getRelations(): array
    {
        return [
            //
        ];
    }
    
    public static function getPages(): array
    {
        return [
            'index' => Pages\ListWebs::route('/'),
            'create' => Pages\CreateWeb::route('/create'),
            'edit' => Pages\EditWeb::route('/{record}/edit'),
        ];
    }    
}

6 posts relacionats

  • Author
    Joan Puig

    posts Array Pdo

    Una manera adequada de nomenar aquesta consulta PDO podria ser "ObtenirPàginesPerCategoriaIEtiqueta... READ MORE
  • Author
    Joan Puig

    Quina és la diferència entre PDO i MySQLi?

    El que no està tan definit és quina és la millor manera de connectar-se a MySQL fent servir PHP. ... READ MORE
  • Author
    Joan Puig

    tailwind 5 filtres i paginacio a postslar11

    tailwind 5 filtres i paginacio a postslar11... READ MORE
  • Author
    Joan Puig

    optimitzar imatges en php

    optimitzar imatges en php... READ MORE
  • Author
    Joan Puig

    migrations

    la migracio crea i administra les taules a la base de dades de laravel... READ MORE
  • Author
    Joan Puig

    paginació en Laravel

    📌 Resum de la paginació en Laravel Laravel proporciona diferents maneres d’implementar la pagi... READ MORE