AthenaeumAthenaeum
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
Packages
  • next
  • current
  • v9.x
  • v8.x
  • v7.x
  • v6.x
  • v5.x
  • v4.x
  • v3.x
  • v2.x
  • v1.x
Changelog
GitHub
  • Version 7.x

    • Release Notes
    • Upgrade Guide
    • New to this...
    • Contribution Guide
    • Security Policy
    • Code of Conduct
    • Origin
  • ACL

    • Introduction
    • How to install
    • Setup
    • Permissions
    • Roles
    • Users
    • Cached Permissions
  • Antivirus

    • Introduction
    • How to install
    • Setup
    • How to use
    • Scanners

      • Introduction
      • ClamAV
      • Null
      • Custom
    • Events
    • PSR
  • Audit

    • Audit
    • How to install
    • Setup
    • Recording
    • Events
  • Auth

    • Introduction
    • How to install
    • Fortify

      • Prerequisites
      • Actions

        • Rehash Password
  • Circuits

    • Circuits
    • How to install
    • Setup
    • Usage
    • Events
  • Collections

    • Collections
    • How to install
    • Summation

      • Summation Collection
      • Items Processor
  • Config

    • Configuration Loader
    • How to install
    • Setup
    • Load Configuration Files
    • Custom File Parsers
  • Console

    • Command and Schedule Registration
    • How to install
    • Setup
    • Commands
    • Schedules
  • Container

    • IoC Service Container
    • How to install
    • Container
    • List Resolver
  • Core

    • Athenaeum Core Application
    • How to install
    • Setup
    • Usage

      • Configuration
      • Service Providers
      • Service Container
      • Events
      • Caching
      • Logging
      • Console
      • Task Scheduling
      • Exception Handling
      • Extending Core Application
      • Testing
  • Database

    • Introduction
    • How to install
    • Models

      • Instantiatable
      • Sluggable
    • Query

      • Criteria (Query Filter)
  • Dto

    • Data Transfer Object (DTO)
    • How to install
    • Create Interface
    • Implement DTO
    • How to use
    • Populate
    • Export
    • Json
    • Serialization
    • Nested DTOs
    • Array DTO
  • ETags

    • Introduction
    • How to install
    • Setup
    • ETags usage

      • How to use
      • Generators

        • Default Generator
        • Custom Generator
      • Eloquent Models
    • Http Request Preconditions

      • Introduction
      • Resource Context
      • Preconditions
      • Actions
      • RFC 9110

        • If-Match
        • If-Unmodified-Since
        • If-None-Match
        • If-Modified-Since
        • If-Range
      • Extensions

        • Introduction
        • Range
      • Range Validator
      • Download Stream
    • Macros
  • Events

    • Register Listeners and Subscribers
    • How to install
    • Setup
    • Listeners
    • Subscribers
  • Filters

    • Search Filter Utilities
    • Prerequisites
    • How to install
    • Setup
    • Processor
    • Filters Builder
    • Predefined Resources

      • Search Processor
      • Sorting Processor
      • Constraints Processor
      • Matching Processor
    • Tip: Create a base builder
  • Flysystem

    • Introduction
    • Database Adapter

      • Introduction
      • How to install
      • Setup
      • Data Deduplication
      • MIME-Type Detection
  • Http

    • Api

      • Http API
      • How to install
      • Setup
      • Resources

        • Introduction
        • Timestamps
        • Self-Link
        • Relations
        • Caching
        • Registrar
      • Requests

        • Introduction
        • List Resources
        • List Deleted
        • Show Resource
        • Create Resource
        • Update Resource
        • Delete Resource
        • List Related
        • Process Multiple Resources
        • Helpers
      • Middleware

        • Introduction
        • Request Must Be Json
        • Capture Fields To Select
        • Remove Response Payload
    • Clients

      • Http Clients
      • How to install
      • Setup
      • Basic Usage
      • Available Methods

        • Fluent Api
        • Protocol Version
        • Base Uri
        • Http Method and Uri
        • Headers
        • Accept & Content-Type
        • Authentication
        • Http Query
        • Payload Format
        • Payload
        • Attachments
        • Cookies
        • Response Expectations
        • Middleware
        • Conditions
        • Criteria
        • Redirects
        • Timeout
        • Debugging
        • Logging
        • Driver Options
        • Driver
      • Http Query Builder

        • Introduction
        • Select
        • Where
        • Dates
        • Include
        • Pagination
        • Sorting
        • Raw Expressions
        • Custom Grammar
    • Cookies

      • Http Cookies
      • How to install
      • Usage
    • Messages

      • Http Messages
      • How to install
      • Serializers
  • Maintenance

    • Modes

      • Maintenance Modes
      • How to install
      • Setup
      • Basic Usage
      • Available Drivers
  • Mime Types

    • MIME-Types
    • How to install
    • Setup
    • Usage
    • Drivers

      • Available Drivers
      • File Info
  • Properties

    • Properties Overload
    • How to install
    • Usage
    • Naming Convention
    • Properties Visibility
  • Redmine

    • Redmine Api Client
    • How to install
    • Setup
    • General Usage

      • Supported Operations
      • Fetch list of resources
      • Find
      • Fetch
      • Create new record
      • Update existing record
      • Delete existing record
      • Relations
    • Available Resources

      • Predefined Resources
      • Attachments
      • Enumerations
      • Issue Relations
      • Users
      • User Groups
      • Roles
      • Project Memberships
      • Versions (Milestones)
      • Issue Categories
      • Trackers
  • Service

    • Service Registrar
    • How to install
    • How to use
  • Streams

    • Streams
    • How to install
    • Setup
    • How to use

      • Introduction
      • Open and Close
      • Raw Resource
      • Seeking
      • Reading
      • Writing
      • Size
      • Truncate
      • Sync
      • Flush
      • Hash
      • MIME-Type
      • Filename
      • Output
      • Locking
      • Transactions
      • Meta
      • Misc
  • Support

    • Introduction
    • How to install
    • Laravel Aware-of Helpers

      • How to use
      • Enforce Via Interface
      • Custom Default
      • Pros and Cons
      • Available Helpers
    • Aware-of Properties

      • Generator
      • Available Aware-of Helpers
    • Live Templates
  • Testing

    • Introduction
    • How to install
    • Test Cases
    • Testing Aware-of Helpers
  • Translation

    • Introduction
    • How to install
    • Exporters

      • Introduction
      • Setup
      • How to use
      • Drivers

        • Introduction
        • Array
        • Lang.js (Array)
        • Lang.js (JSON)
        • Cache
  • Utils

    • Introduction
    • How to install
    • Array
    • Duration
    • Json
    • Math
    • Memory
    • Method Helper
    • Invoker
    • Populatable
    • String
    • Version
  • Validation

    • Introduction
    • How to install
    • Setup
    • Rules

      • Alpha-Dash-Dot
      • Date Format
      • Semantic Version
You are viewing documentation for an outdated version. It is no longer supported!

Release Notes

  • Support Policy
  • v7.x Highlights
    • PHP v8.1 and Laravel v10.x
    • Http Conditional Requests
    • DownloadStream Response Helper
    • API Requests
    • Api Resource Http Caching
    • Custom Queries for Search and Sorting Filters
    • Remove Response Payload Middleware
    • Attach File Stream for Http Client
    • Improved Status object
    • Stream hash() accept hashing options
    • Stream sync() is now supported
    • to() memory unit method
  • Changelog

Support Policy

Athenaeum attempts to follow a release cycle that matches closely to that of Laravel. However, due to limited amount of project maintainers, no guarantees can be provided.

VersionPHPLaravelReleaseSecurity Fixes Until
8.x8.2 - ?v11.x~1st Quarter 2024TBD
7.x*8.1 - 8.2v10.xFebruary 16th, 2023February 2024
6.x8.0 - 8.1v9.xApril 5th, 2022February 2023
5.x7.4v8.xOctober 4th, 2020N/A
< 5.x--See CHANGELOG.mdN/A

*: current supported version.

TBD: "To be decided".

v7.x Highlights

These are the highlights of the latest major version of Athenaeum.

PHP v8.1 and Laravel v10.x

PHP version v8.1 is now the minimum required version for Athenaeum. Laravel v10.x packages are now used.

Http Conditional Requests

The ETags package has been upgraded to offer support for RFC 9110's conditional requests. The following preconditions are supported by default:

  • If-Match
  • If-Unmodified-Since
  • If-None-Match
  • If-Modified-Since
  • If-Range

See documentation for details.

DownloadStream Response Helper

As a part of the ETags package, a DownloadStream response helper is now available. It is able to create streamed response for Range requests.

use Illuminate\Support\Facades\Route;
use Aedart\ETags\Preconditions\Responses\DownloadStream;

Route::get('/downloads/{file}', function (DownloadFileRequest $request) {

    return DownloadStream::for($request->resource)
        ->setName($request->route('file'));
});

API Requests

The Http Api package has been upgraded with a few Request abstractions. These can speed up development of API endpoints.

Example Request

use Aedart\Http\Api\Requests\Resources\ShowSingleResourceRequest;
use Illuminate\Database\Eloquent\Model;
use App\Models\User;

class ShowUser extends ShowSingleResourceRequest
{
    public function findRecordOrFail(): Model
    {
        return User::findOrFail($this->route('id'));
    }

    public function mustEvaluatePreconditions(): bool
    {
        return true;
    }
}

Example Action

Route::get('/users/{id}', function (ShowUser $request) {
    return UserResource::make($request->record)
        ->withCache();
})->name('users.show');

Api Resource Http Caching

Additionally, Api Resources now have the ability to set Caching headers, ETag, and Last-Modified date, via a single method:

Route::get('/addresses/{id}', function ($id) {
    return new AddressResource(Address::findOrFail($id))
        ->withCache();
});

See documentation for details.

Custom Queries for Search and Sorting Filters

The SearchFilter and SearchProcessor now support custom search callbacks.

use Aedart\Filters\Processors\SearchProcessor;
use Illuminate\Contracts\Database\Query\Builder;
use Illuminate\Contracts\Database\Eloquent\Builder as EloquentBuilder;

$processor = SearchProcessor::make()
        ->columns(function(Builder|EloquentBuilder $query, string $search) {
            return $query
                ->orWhere($column, 'like', "{$search}%");
        });

The same applies for the SortFilter and SortingProcessor.

use Aedart\Filters\Processors\SortingProcessor;

$processor = SortingProcessor::make()
        ->sortable([ 'email', 'name'])
        ->withSortingCallback('email', function($query, $column, $direction) {
            return $query->orderBy("users.{$column}", $direction);
        });

Remove Response Payload Middleware

A new middleware has been added for the Http Api package, which is able to remove a response's body, when a custom query parameter is available. See middleware documentation for details.

Attach File Stream for Http Client

The Http Client now supports uploading a file stream.

use Aedart\Streams\FileStream;

$response = $client  
        ->attachStream('2023_annual.pdf', FileStream::open('/reports/2023_annual.pdf', 'r'))
        ->post('/reports/annual');

Improved Status object

The Status object that is provided for response expectations has been improved. It now contains several helper methods for determining if it matches a desired Http status code.

use Aedart\Contracts\Http\Clients\Responses\Status;
use Teapot\StatusCode\All as StatusCode;

$client
    ->expect(function(Status $status){
        if ($status->isBadGateway()) {
            // ...
        }
            
        if ($status->is(StatusCode::UNPROCESSABLE_ENTITY)) {
            // ...
        }
        
        if ($status->satisfies([ StatusCode::CREATED, StatusCode::NO_CONTENT ])) {
            // ...
        }
        
        // ... etc
    });

Stream hash() accept hashing options

Streams now accept and apply hashing options in hash() method. This was previously also supported, but required PHP v8.1. PHP version check is no longer performed internally. See documentation for more details.

Stream sync() is now supported

File streams can now have their content synchronised to file, via the sync() method. See example.

to() memory unit method

The Memory utility now offers a to() method, which allows specifying a string unit to convert the memory unit into.

echo Memory::unit(6_270_000_000) // bytes
    ->to('gigabyte', 2); // 6.27

Changelog

Make sure to read the changelog for additional information about the latest release, new features, changes and bug fixes.

Edit page
Last Updated: 18/03/2024, 10:45
Contributors: Alin Eugen Deac, alin
Next
Upgrade Guide