Skip to content

kigathi-chege/lyre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lyre

License

About Lyre

Lyre is a php package built for Laravel. Lyre works together with the rich Laravel ecosystem, and goes hand in hand with its philosophy of expressive, elegant syntax. It takes enjoyable and creative development a step further and makes you feel the harmony of it all as the elements come together. Lyre utilizes the following to create the rhythm of the future:

Lyre is accessible, powerful, and it is your next favorite tool.

Get started right away

composer require lyre/lyre
  • Add LyreServiceProvider to your providers array under bootstrap > providers.php
  • Clear configuration cache
php artisan make:all Post
  • Add your columns to your migration and migrate

  • Add your model to your routes file

Route::apiResource('posts', PostController::class);
  • Consume your API!

  • Guess what? That's it.

Dependencies

Digging Deeper

Filters

Column Filters

  • Easily return data filtered by a specific column
$data = $this->postRepository->columnFilters(['status' => 'active'])->all();

Range Filters

  • Easily filter your data by range, for example, created_at!
$data = $this->postRepository->rangeFilters(['created' => [now()->subHours(24), now()])->all();

Relation Filters

  • You can even return your data filtered by specific relationships!
$data = $this->postRepository->relationFilters('author' => 'id,1')->all();

Search Query

  • Search through your repository!
$data = $this->postRepository->searchQuery(['search' => 'lyre'])->all();

Method Chaining

  • What is more? You can chain all these methods to fine tune your query!
$data = $this->postRepository->columnFilters(['status' => 'active'])
       ->rangeFilters(['created' => [now()->subHours(24), now()])
       ->relationFilters('author' => 'id,1')
       ->searchQuery(['search' => 'lyre'])
       ->all()

License

Lyre is open-sourced software licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages