TonnnnUK's avatar
Level 13

LaraDocs - A documentation search tool for the Laravel ecosystem, associated frameworks & packages.

Firstly apologies if this isn't the right place to post, but I'm hoping to provide a useful tool for all Laravel developers out there.

I have recently created laradocs.dev

As a developer I often find myself forever delving into my bookmarks. There's the usual Laravel docs of course, they are fantastic! Then I love me some Livewire so we need to open up a new tab for that. Tailwind is immense, and so to is the amount of classes and features I have to remember so I need that open too. Now I need to manage some of the stuff in the database and I'm headed over to Filament to get some CMS on the go. And since I'm doing that calendar thing, I need to recap on some Carbon magic.

You get the picture! Even the best developers live in the docs, right?

I figured it would be much easier to be able to search in 1 place across all the docs and hitting a link to the exact section of the exact page I need as and when I need a reference of some function or feature!

Initially I made this for myself but figured others would benefit from it.

I would love you all to benefit from using it. I'm also eager to hear your thoughts, suggestions and feedback.

0 likes
2 replies
LaryAI's avatar
Level 58

It sounds like you've created a very useful tool for the Laravel community! Here are some suggestions and feedback to help you improve and expand LaraDocs:

  1. Search Functionality:

    • Ensure that the search functionality is fast and accurate. Consider using a search engine like Algolia or Elasticsearch to index the documentation and provide quick search results.
  2. Documentation Sources:

    • Make sure to include a wide range of documentation sources. Besides Laravel, Livewire, Tailwind, Filament, and Carbon, consider adding other popular packages and tools in the Laravel ecosystem such as Laravel Nova, Laravel Cashier, Laravel Passport, etc.
  3. User Interface:

    • Keep the user interface clean and intuitive. A simple search bar with filters to narrow down the search results by documentation source can be very helpful.
  4. Bookmarking and History:

    • Allow users to bookmark their favorite documentation pages and keep a history of their searches. This can help users quickly revisit frequently accessed pages.
  5. Community Contributions:

    • Open up the platform for community contributions. Allow users to suggest new documentation sources or report issues with the current ones.
  6. API Integration:

    • Provide an API that developers can use to integrate LaraDocs search functionality into their own tools and workflows.
  7. Mobile Optimization:

    • Ensure that the site is mobile-friendly so that developers can access the documentation on the go.
  8. Feedback Mechanism:

    • Include a feedback mechanism on the site so users can easily provide suggestions or report issues.

Here is a simple example of how you might set up a search functionality using Laravel and Algolia:

// Install Algolia Scout package
composer require algolia/algoliasearch-client-php
composer require laravel/scout

// Add Scout service provider in config/app.php
'providers' => [
    // Other service providers...
    Laravel\Scout\ScoutServiceProvider::class,
],

// Add Algolia credentials in .env file
ALGOLIA_APP_ID=your_algolia_app_id
ALGOLIA_SECRET=your_algolia_secret

// Configure Scout in config/scout.php
'driver' => env('SCOUT_DRIVER', 'algolia'),
'algolia' => [
    'id' => env('ALGOLIA_APP_ID', 'your_algolia_app_id'),
    'secret' => env('ALGOLIA_SECRET', 'your_algolia_secret'),
],

// Create a model for documentation
php artisan make:model Documentation -m

// Define the model and make it searchable
use Laravel\Scout\Searchable;

class Documentation extends Model
{
    use Searchable;

    protected $fillable = ['title', 'content', 'url'];

    public function toSearchableArray()
    {
        return [
            'title' => $this->title,
            'content' => $this->content,
            'url' => $this->url,
        ];
    }
}

// Index the documentation
Documentation::create([
    'title' => 'Laravel Installation',
    'content' => 'To install Laravel, you need to...',
    'url' => 'https://laravel.com/docs/installation',
]);

// Search the documentation
$results = Documentation::search('installation')->get();

This is a basic example to get you started. You can expand on this by adding more features and improving the search functionality.

Good luck with LaraDocs, and thank you for contributing to the Laravel community!

1 like
TonnnnUK's avatar
Level 13

Well that's the roadmap sorted out! Cheers Lary!

Please or to participate in this conversation.