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

Devnote Laravel Package

creative-syntax/devnote

Devnote is a Laravel package that adds a small notes/todos widget to your app during local development. After installation it appears at the bottom-right of every page when APP_ENV=local and automatically disables in production.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require creative-syntax/devnote
    

    Publish the package configuration (if needed):

    php artisan vendor:publish --provider="CreativeSyntax\DevNote\DevNoteServiceProvider" --tag="config"
    
  2. First Use Case

    • Create a note/todo:
      use CreativeSyntax\DevNote\Facades\DevNote;
      
      DevNote::addNote('Fix login bug', 'auth', 'high');
      
    • View all notes:
      php artisan devnote:list
      
    • Mark as complete:
      DevNote::completeNote(1); // ID from list
      
  3. Where to Look First

    • Artisan Commands: php artisan devnote:list, php artisan devnote:clear
    • Facade: CreativeSyntax\DevNote\Facades\DevNote
    • Config: config/devnote.php (if published)

Implementation Patterns

Core Workflows

  1. Note Management

    • Add notes with context (e.g., module, priority):
      DevNote::addNote('Refactor user model', 'users', 'medium');
      
    • Filter notes by module/priority:
      $notes = DevNote::getNotes(['module' => 'auth', 'priority' => 'high']);
      
  2. Integration with Laravel

    • Middleware for visibility:
      public function handle($request, Closure $next) {
          $notes = DevNote::getNotes(['module' => request()->route()->getName()]);
          view()->share('devNotes', $notes);
          return $next($request);
      }
      
    • Blade template:
      @foreach($devNotes as $note)
          <div class="note {{ $note->priority }}">
              {{ $note->title }} ({{ $note->module }})
          </div>
      @endforeach
      
  3. Automation

    • Hook into events (e.g., Illuminate\Foundation\Bootstrapped):
      public function boot() {
          DevNote::checkForOverdueNotes(); // Hypothetical method
      }
      

Gotchas and Tips

Pitfalls

  1. Storage Location

    • Notes are stored in storage/framework/devnotes.json by default. Ensure the storage directory is writable.
    • Fix: Run chmod -R 775 storage if permissions are denied.
  2. No Database Dependency

    • Notes are file-based. Not ideal for production or multi-environment setups.
    • Workaround: Extend the package to support a database driver (see "Extension Points").
  3. Priority Handling

    • Priorities (high, medium, low) are case-sensitive. Use lowercase consistently.

Debugging

  1. Clear Corrupted Data

    php artisan devnote:clear
    
    • Rebuilds the JSON file from scratch.
  2. Check File Permissions

    • Verify storage/framework/devnotes.json is writable.

Extension Points

  1. Custom Storage

    • Override the storage path in config/devnote.php:
      'storage_path' => storage_path('app/devnotes/custom.json'),
      
  2. Add Custom Fields

    • Extend the CreativeSyntax\DevNote\Models\Note model (if the package allows it) or use a wrapper:
      DevNote::addNote('Note', 'module', 'priority', ['custom_field' => 'value']);
      
  3. API Endpoints

    • Create a custom controller to expose notes via API:
      Route::get('/api/devnotes', function () {
          return DevNote::getNotes();
      });
      

Pro Tips

  • Tag Notes for Searchability
    DevNote::addNote('Note', 'module', 'priority', ['tags' => ['bug', 'auth']]);
    
  • Sync Notes Across Environments Use a shared storage solution (e.g., S3) for the JSON file in team setups.
  • CI/CD Integration Exclude storage/framework/devnotes.json from version control (add to .gitignore).
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.
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views
spatie/ignition-contracts
earls/stork-command-queue-bundle