Download the PHP package nfragkos/eloquenty without Composer

On this page you can find all versions of the php package nfragkos/eloquenty. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package eloquenty

Eloquenty Statamic Addon

This package allows you to store entries for specific collections to the database via Laravel's Eloquent ORM.

Structures are disabled for performance reasons.

Requirements

How it works

Eloquenty uses Statamic Eloquent Driver (https://github.com/statamic/eloquent-driver) but with modifications that allows to use the driver for specific collections entries instead for every entry.

Screenshot 2021-01-27 162333 Both standard and Eloquenty collections will be visible under /cp/collections but the Entries column will display the message "Managed by Eloquenty" for Eloquenty collections.

Screenshot 2021-01-27 162410 Eloquenty collections are managed on a separate route /cp/eloquenty/collections which is a clone of /cp/collections route group with modifications to use the Entry and EntryRepository classes under Eloquenty\Entries that uses Eloquent ORM. The Entry related classes and Controllers are extending the original Statamic classes.

There's a middleware that redirects from /cp/collections/{collection} to /cp/eloquenty/collections/{collection} when clicking to view Eloquenty collections under /cp/collections.

Collection modifications should be performed under the original /cp/collections route.

Installation

You can install this package via composer using:

The package will automatically register itself.

Post-Install

  1. Publish eloquenty config and migration files:

    php artisan vendor:publish --provider="Eloquenty\ServiceProvider"

  2. Run php artisan migrate to create Eloquenty table.
    (Make sure laravel is configured properly and schema is created. See https://laravel.com/docs/8.x/database#configuration)

  3. Create a new collection or enter existing collection handle in config/eloquenty.php:

    This means that the entries for blog collection will be handled by Eloquenty.

  4. If you entered an existing collection to Eloquenty config, there's an import command to import entries to the database:

    Please delete your collection entries from the filesystem after you verify that entries are imported successfully.

Usage

Eloquenty now should be visible now under Content section of the navigation menu in Control Panel. CRUD for Eloquenty collections works the same way as standard collections.

Antlers

In Antlers templates use the eloquenty tag instead of the collection tag for Eloquenty collections:

Data retrieval and manipulation

Calling the queryEntries() method of Collection repository, will return the correct QueryBuilder for Eloquenty collections:

Alternatively you can use the Facade Eloquenty::repository() method or EloquentyEntry::query() to retrieve the instance of EntryRepository (implements Statamic\Contracts\Entries\EntryRepository):

Keep in mind that calling the whereCollection() method will fetch all entries in the table. You should use the query() method instead that returns the query builder instance to build your query.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Pull requests are welcome and will be fully credited.

  1. Fork the repo and create your branch from main branch.
  2. Update the README file if needed.
  3. Make sure your code follows the PSR-2 coding standard.
  4. Issue that pull request!

License

The MIT License (MIT). Please see License File for more information.

Credits

Many thanks to Statamic for the Eloquent driver and the awesome CMS :heart:

Coffee

If you like this addon please consider buying me a coffee:

paypal


All versions of eloquenty with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0|^8.3.0
laravel/framework Version ^10.0|^11.0|^12.0
statamic/cms Version ^v5.21.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nfragkos/eloquenty contains the following files

Loading the files please wait ...