vibecode.wiki
RU EN
~/wiki / server-i-logika / biblioteki-laravel

Laravel libraries: what they are, why they are needed, how to install them, what to choose

◷ 9 min read 3/3/2026

Next step

Open the bot or continue inside this section.

$ cd section/ $ open @mmorecil_bot

Article -> plan in AI

Paste this article URL into any AI and get an implementation plan for your project.

Read this article: https://vibecode.morecil.ru/en/server-i-logika/biblioteki-laravel/ Work in my current project context. Create an implementation plan for this stack: 1) what to change 2) which files to edit 3) risks and typical mistakes 4) how to verify everything works If there are options, provide "quick" and "production-ready".
How to use
  1. Copy this prompt and send it to your AI chat.
  2. Attach your project or open the repository folder in the AI tool.
  3. Ask for file-level changes, risks, and a quick verification checklist.

Imagine: you decided to launch your first Telegram bot to receive pizza orders. Or create a convenient admin for an online store, where managers will manage orders, customers and reports.

Without packages, you spend more time writing your code for webhooks, file downloads, roles and rights, tables and forms. Every time you test, catch bugs, update when you release a new version of Laravel.

One composer require command, two or three prompts in Claude or Codex – and you have ready-made working functionality that is already used by thousands of developers around the world.

This article is a **complete guide ** where we'll take a look at:

  • What are Laravel packets on your fingers
  • Why you need them (and why you lose time and money without them)
  • Step-by-step instructions for installation and use
  • Top 2026 packages for Telegram bots and web interfaces
  • How to get AI to implement them for you (with ready-made prompts)
  • Real example: bot + admin in one evening
  • Frequent mistakes and how to avoid them
  • Checklist before launch into production

It’s as simple as possible, with code examples, comparison tables and prompts that you can copy right now.

What are Laravel packages and how do they differ from regular PHP libraries

Laravel packets are ready-made, tested code modules that are connected via a Composer command. Officially, Laravel calls them packages.

Unlike simple PHP libraries (such as Carbon for working with dates), Laravel packages are smart add-ons that:

  • New Artisan Commands (php artisan telegraph:webhook)
  • Create table migrations in the database
  • Register routes, middleware, facades
  • Publish configs and Blade templates
  • Integrate with Eloquent Models and Livewire

The Laravel 12 does almost all registration automatically – you don’t have to write anything manually.

The *Spatie/laravel-permission package gives you a full-fledged role-permission system ($user->assignRole('admin')) in 10 minutes, although manually it would take 3-4 days.

Why do you even need packages?

Let’s compare the two approaches to a real project.

** Classical Jun 2023:

  • Write your middleware to verify your rights – 2 days
  • Download and process photos/video – week
  • Set up a webhook for Telegram – another week + debugging on the market
  • Bottom line: 3-4 weeks only on basic features + constant bugs when updating Laravel

**Variant of Wibcoder 2026:

  • composer require spatie/laravel-medialibrary defstudio/telegraph filament/filamentXX
  • 30-60 minutes to set up
  • Everything has been tested by thousands of developers
  • Automatic security updates
  • AI generates 80% of code for your project

** The main advantages of packages**:

  1. **Savings of time: Weeks turn into hours.
  2. Quality and safety - Community code that is updated.
  3. AI support - modern models are well aware of popular packages and give ready-made code.
  4. Clean project – your code remains minimal and clear.
  5. Scalability - It's easy to add new features later.

The only downside is that sometimes the package can be redundant for a super-simple project.

How to Install and Use Laravel Packages (Relevant for Laravel 12)

  1. Find the package Best sources:

    • packagist.org
    • laraveldaily.com/packages
    • github.com/spatie (gold quality standard)
    • filamentphp.com and getmoonshine.app
  2. Install

    bash
    composer require vendor/packagename
  3. Publish config (if required)

    bash
    php artisan vendor:publish --tag=telegram-config

Or use the flags: --provider="Filament\FilamentServiceProvider"

  1. Run migrations (if the package adds tables)

    bash
    php artisan migrate
  2. Configure .env (tokens, keys) Add variables and restart the server.

  3. Use In controllers, models, Blade or Livewire – like a regular Laravel code.

Done! Laravel 12 automatically registers service providers.

Top libraries for Telegram bots in 2026

Here is the current top for March 2026 (by downloads, GitHub stars and community reviews):

Пакет Скачивания / Звёзды GitHub Зачем нужен (простыми словами) Время на запуск Кому подойдёт
defstudio/telegraph 280 000+ / 811 Самый удобный «laravel-way»: fluent API, клавиатуры, вебхуки, Artisan-команды 10–15 мин Новичкам и быстрым проектам
nutgram/laravel Активно растёт Современный, быстрый, с кэшем и middleware 15 мин Проектам с высокой нагрузкой
irazasyed/telegram-bot-sdk 4+ млн Классика с полным покрытием Bot API 10 мин Сложной логике и старым проектам

Telegraph is the absolute favorite of 2025-2026 for those who want to “just work”. Team php artisan telegraph:webhook and ready.

Top libraries for web interfaces and admins

Пакет Скачивания / Звёзды GitHub Зачем нужен Время на запуск Когда выбирать
filament/filament (v5) Миллионы / 29 600+ Король админок: таблицы, формы, дашборды, виджеты — всё на чистом PHP 15–30 мин Любая серьёзная админка
moonshine/moonshine (v4) Растёт / 1 300+ Лёгкая, быстрая, с встроенным ИИ и Telegram-уведомлениями 20 мин Когда нужна простота + AI из коробки

Filament v5 is the absolute leader. Adminka in 15 minutes, perfectly integrates with Spatie, Media Library and Livewire. MoonShine 4 is a strong competitor with AI-tools (autogenerate fields according to the description).

Mandatory packages

  • spatie/laravel-permission – roles and rights
  • spatie/laravel-medialibrary – uploading and storing files
  • laravel/sanctum – API-authorization for mobile and SPA
  • spatie/laravel-backup - automatic backups of database and files

They all work perfectly together with Telegraph and Filament.

How to implement packages through AI: ready-made prompts that work

This is where the real magic of 2026 begins. You don't write code manually anymore.

Universal Prompt template (copy and change):

code
I'm on Laravel 12+ [package name]. It is necessary to implement [the task description in detail].
Use the latest version of the package. Add migration, models, access policies, validation.
Output the full working code + step-by-step installation plan. Everything should be clean and modern.

**Example for Telegram bot (Telegraph):

code
I'm on Laravel 12 + defstudio/telegraph. Create a bot to take pizza orders.
Commands: /start, /menu, /order.
Inline buttons: “Margarita”, “Pepperoni”, “Add to the cart”, “Pay”.
Save orders in the order table (create migration and model).
Add middleware only to authorized users via Sanctum.
Output the full code: bot class, routes, controller, migration and how to configure webhook.

Example for adminka (Filament):

code
Laravel 12 + Filament v5. Create an OrderResource resource with fields:
status (select: new / in work / ready / issued), amount (money), client (belongsTo User).
Add the widget to the dashboard - the total amount of orders for today.
Connect Spatie Permission: Only the admin role sees this resource.
Output the full resource code + how to register in the panel.

An example for MoonShine with AI:

code
Laravel 12 + MoonShine 4. Using built-in AI, create a resource for the Order model. Automatically generate fields and forms.
Add the button “Send notification to Telegram”.

Real example: Telegram-bot + Filament-admin

  1. Create a project

    bash
    laravel new pizza-bot --pest
    cd pizza-bot
  2. Installing packages

    bash
    composer require defstudio/telegraph filament/filament spatie/laravel-permission spatie/laravel-medialibrary
    php artisan filament:install --panels
    php artisan migrate
  3. We give AI two prompts (from the section above) → we get a bot and an admin.

  4. Configure webhook

    bash
    php artisan telegraph:webhook
  5. Launch

    bash
    php artisan serve

Open /admin - we see a beautiful order table in real time. The bot takes orders, the admin shows them instantly.

Everything works: roles, files, notifications.

Frequent Beginner Mistakes and How to Avoid Them

  • Forgot to publish the config. the package does not work.
  • There are no migrations at all.
  • An outdated version of Laravel → conflicts.
  • Ignore the documentation of the package → extra hours of debugging.
  • Do not check access rights to security holes.

Solution: Always read README on GitHub after installation and use AI to check.

Checklist before launching the project in production

  • Compatibility with Laravel 12 tested
  • All configs published
  • Migration applied
  • Tokens and keys in .env (not in code!)
  • Access rights via Spatie configured
  • Backup configured (spatie/laravel-backup)
  • Testing through AI Test Generation
  • Deployment to VDS (Timeweb, Hetzner, etc.)

Laravel-packages in 2026 is not “cheating”, but a standard of modern development.