Introducing Grocery CRUD v3.1

We are excited to introduce Grocery CRUD version 3.1, a version designed with your peace of mind as our top priority. We've made significant improvements and added new features to ensure a worry-free experience for you. Read on to discover what's new in this version.

In the latest version of Grocery CRUD, version 3.1, we have focused on making it the version that you worry less about:

Furthermore, version 3.1 has now caught up with all the features and details that were missed from version 2.

Default Configuration Changes

You don't need to worry if you have included all the configurations. Now, if a configuration is missing, we are replacing it with the default configuration value. This means that you can have a configuration file with only the values that you want to change.

New Configuration Value: `display_js_files_in_output`

This new configuration value allows you to include JavaScript files in the main output and not return them at the 'js_files' variable. This is useful for quicker installations/demos, but it is recommended to set this to false and have all of your JavaScript files at the bottom of your page before the closing body tag. Please consider that when JavaScript files are included directly in the output, you lose the ability to control when and where these files are loaded. We will have more documentation on this soon.

3.0 to 3.1 Upgrade

Upgrading from version 3.0 to 3.1 is straightforward and doesn't require any special steps. Despite the fact that we have refactored a lot of background sections, there are no breaking changes. Therefore, a simple

composer update --prefer-dist

as usual, and the copy of the asset/public files is more than enough.

Also, if you are using Codeigniter 4 or Laravel 10 you can have the public files updated with the same command.

Codeigniter 4

More specifically for Codeigniter 4 if your composer.json file has the following:

    "scripts": {
        "test": "phpunit"
    },

You can change it to:

    "scripts": {
        "test": "phpunit",
        "post-update-cmd": "@php spark publish"
    },

This will automatically copy the public files to the public folder of Codeigniter 4 when you run the command of the composer update. In order to do so, you will need to also have the file GroceryCrudPublisher.php in the app/Publishers folder.

Laravel 10

For Laravel 10, you can have the public files updated with a similar command. If your composer.json file has the "scripts" that looks like this:

"scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },

Add the line:

"@php artisan vendor:publish --provider=\"GroceryCrud\\LaravelAssetsServiceProvider\""

on "post-update-cmd"

so your "scripts" will look like this:

"scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
            "@php artisan vendor:publish --provider=\"GroceryCrud\\LaravelAssetsServiceProvider\""
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },

and everytime you run the command:

composer update --prefer-dist

will also copy the public files to the public folder of Laravel 10.

Last but not least

We believe these changes and improvements will greatly enhance your experience with Grocery CRUD. We appreciate your support and look forward to your feedback on version 3.1 🤗🤗🤗.

You can find the full change log from version 3 to 3.1:

Feb 08, 2024 by John Skoubourdis