Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tissue Laravel Package

cleentfaar/tissue

Laravel package to speed up building UI and pages with reusable “tissue” components, helper utilities, and starter structure. Aims to simplify common app scaffolding and keep views consistent across projects with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require cleentfaar/tissue
    

    Publish the config (if available) with:

    php artisan vendor:publish --provider="Cleentfaar\Tissue\TissueServiceProvider"
    
  2. First Use Case: Centralized String Manipulation Tissue likely provides utility methods for common string operations (e.g., slugging, truncation). Test it in a controller or helper:

    use Cleentfaar\Tissue\Facades\Tissue;
    
    $slug = Tissue::slug('Hello World!'); // Output: "hello-world"
    $truncated = Tissue::truncate('Long text...', 10); // Output: "Long text..."
    
  3. Where to Look First

    • Facade: Check Cleentfaar\Tissue\Facades\Tissue for the primary API.
    • Service Provider: Review Cleentfaar\Tissue\TissueServiceProvider for bindings and boot logic.
    • Documentation: If available, scan for utility methods (e.g., Tissue::camelCase(), Tissue::snakeCase()).

Implementation Patterns

1. Centralized Utility Layer

Replace repetitive string/array operations in controllers/models with Tissue calls:

// Before (boilerplate)
$title = str_replace(['-', '_'], ' ', $request->title);
$title = ucwords($title);

// After (centralized)
$title = Tissue::humanize($request->title);

2. Integration with Laravel Services

Bind Tissue utilities to Laravel’s container for dependency injection:

// In a service class
public function __construct(private Tissue $tissue) {}

public function process(string $input): string {
    return $this->tissue->slug($input);
}

3. Extending Tissue

Add custom methods by extending the core class or creating a decorator:

// app/Providers/TissueServiceProvider.php
public function boot() {
    Tissue::extend('customMethod', function ($input) {
        return strtoupper($input);
    });
}

Usage:

Tissue::customMethod('hello'); // "HELLO"

4. Configuration Overrides

If the package publishes config, override defaults in config/tissue.php:

'slug' => [
    'separator' => '-', // Default: '-'
    'lowercase' => true,
],

5. Testing Utilities

Mock Tissue in PHPUnit tests:

$this->partialMock(Tissue::class, ['slug'])
     ->shouldReceive('slug')
     ->with('test')
     ->andReturn('test-slug');

Gotchas and Tips

Pitfalls

  1. Outdated Package

    • Last release: 2014. Verify if the API matches Laravel’s current version (e.g., Laravel 5.x vs. 10.x). Test thoroughly.
    • Workaround: Fork the repo and update dependencies (e.g., laravel/framework) if critical.
  2. Lack of Documentation

    • Assume undocumented methods may break. Use php artisan tinker to explore:
      \Cleentfaar\Tissue\Facades\Tissue::methods();
      
  3. Namespace Collisions

    • If using Tissue as a facade, ensure no conflicts with other packages (e.g., Tissue in a custom namespace).
  4. Performance Overhead

    • Tissue is lightweight, but avoid overusing it for micro-optimizations (e.g., replace Tissue::trim() with native trim() if called in tight loops).

Debugging Tips

  • Enable Debug Mode: Check if Tissue logs actions (e.g., via config/tissue.php).
  • Check Bindings: Verify the service provider registers the facade correctly:
    php artisan package:discover
    
  • Fallback to Raw PHP: If a method fails, implement it manually and submit a PR to the package.

Extension Points

  1. Custom Facade Aliases Override the facade in config/app.php:

    'aliases' => [
        'Tissue' => Cleentfaar\Tissue\Facades\CustomTissue::class,
    ],
    
  2. Event Listeners If Tissue triggers events (e.g., Tissue\Events\StringProcessed), listen in EventServiceProvider:

    protected $listen = [
        'Tissue\Events\StringProcessed' => [
            'App\Listeners\LogProcessedString',
        ],
    ];
    
  3. Middleware for Global Processing Use Tissue in middleware to pre-process requests/responses:

    public function handle($request, Closure $next) {
        $request->merge([
            'slug' => Tissue::slug($request->title),
        ]);
        return $next($request);
    }
    

Pro Tips

  • Pair with Laravel Mixins: Combine Tissue with spatie/laravel-mixins for dynamic utility extensions.
  • Type-Hinting: Add PHPDoc annotations for IDE autocompletion:
    /** @var \Cleentfaar\Tissue\Facades\Tissue */
    $tissue;
    
  • Backup Original Methods: Before extending, cache original methods:
    $originalSlug = Tissue::getMethod('slug');
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver