laravel / pennant

A simple, lightweight library for managing feature flags.
https://laravel.com/docs/pennant
MIT License
474 stars 48 forks source link

Make timestamp column names easy to change #90

Closed thijsvdanker closed 6 months ago

thijsvdanker commented 6 months ago

Our database schema uses camelCase for column names instead of snake_case.

Eloquent models allow you to change the column names for the timestamp columns and it would be really nice if we could do the same in Pennant.

It would allow us to extend the DatabaseDriver and just change the two constants instead of overriding the getAll() insert() and update() functions.

<?php

namespace App\Extensions;

use Laravel\Pennant\Drivers\DatabaseDriver;

class CustomDatabaseDriver extends DatabaseDriver
{
    const CREATED_AT = 'dateCreated';
    const UPDATED_AT = 'dateModified';
}