This is the package I use for my Record Collection on this site. It provides a searchable HTML interface, an API interface and an administrative interface.
composer require escuccim/recordcollection
Then register the components in /config/app.php:
Add the following to the 'providers' array:
And add the following to 'aliases' array:
Run the database migrations to create the blog tables and update the users table:
php artisan migrate
You must publish the pagination and config files with:
php artisan vendor:publish --tag=config
By default I use a middleware I call 'admin' to verify if the user has permission to access the administrative pages. If you wish to use this you need to register the middleware in /app/Http/Kernel.php in $routeMiddleware:
'admin' => \Escuccim\RecordCollection\Middleware\AdminMiddleware::class,
If you wish to use your own middleware or stick with Laravel's Auth middleware you can do so by updating the config (see below).
This package contains its own routes, models, controllers and views so should work after installation. To access it just go to /records.
If you wish to edit my views or other files you can publish them to your application:
php artisan vendor:publish
This will publish all of the files. To only publish certain files add
--tag=[group], using the groups listed below:
To add additional languages, publish the lang files and then create new directories under /resources/lang/vendor/record-lang corresponding to the language you wish to add. Copy the records.php file into your new directory and put the translations into the new language into the array.
Note that out of the box the blog will use the languages specified in config/app.php under 'locale'. If you wish to have the blog translate on a per request basis you will need to provide the code for this, or use my package escuccim/translate.
To access the configuration files you need to publish the config file to /config/blog.php with
php artisan vendor:publish --tag=config.
The config file has the following values: