PHP code example of anish / text-input-entry

1. Go to this page and download the library: Download anish/text-input-entry library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anish / text-input-entry example snippets




namespace App\Filament\Resources\Users\Pages;

use Filament\Resources\Pages\ViewRecord;
use Anish\TextInputEntry\Traits\TextInputEntryTrait;

class ViewUser extends ViewRecord
{
    use TextInputEntryTrait;

    protected static string $resource = UserResource::class;
}



namespace App\Filament\Resources\Users\Schemas;

use Filament\Schemas\Schema;
use Anish\TextInputEntry\Infolists\Components\TextInputEntry;
use Filament\Support\Enums\TextSize;
use Illuminate\Support\Facades\Auth;

class UserInfolist
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                TextInputEntry::make('name')
                    ->editable(true)
                    ->size(TextSize::Large)
                    ->rules(['

TextInputEntry::make('field_name')
    ->editable(true)
    ->border(true)

TextInputEntry::make('email')
    ->rules(['

TextInputEntry::make('name')
    ->updateStateUsing(function ($value, $record) {
        $record->name = $value;
        $record->save();

        // Custom logic here
        Log::info("Name updated to: {$value}");
    })

TextInputEntry::make('name')
    ->border(false) // Hides the border, shows as plain text until focused

TextInputEntry::make('email')
    ->icon('heroicon-o-envelope')
    ->iconPosition('before')

TextInputEntry::make('name')
    ->editable(fn ($record) => auth()->user()->can('update', $record))