Download the PHP package eftersom/larafeed without Composer
On this page you can find all versions of the php package eftersom/larafeed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package larafeed
System Requirements
- PHP >= 7.3
- Laravel >= 6. (through to 9.)
Introduction
Larafeed is an open source package for use within Laravel applications. This package focuses on allowing users to add an RSS feed reader to an existing Laravel application. Usable by multiple users within the same application.
Adding and removing feeds is simple! Search for a feed and if it's not right for you click on the 'x' to remove it.
A user can also share and view other user feeds within the same application.
Initial Setup
Composer
Install by running the below command:
Publishing Public Package Files
Once that's installed, run:
Choose
This will install styles and images from the package and ensure they are useable in your project.
Running Migrations
Your migrations should be readily available, run:
If something goes wrong, then rollback your migration and refer to the next section.
Optional: Publish Migrations
The current feed structure should work for most projects without the need to change the database. However, if you have a different database setup, for instance maybe you're not using uuids for your user id. Then you will also need to run the following command:
Then choose the option:
This will copy the required migrations from the larafeed package into the main application database/migrations folder. From here you must change the migrations to suit your needs. As in the previous example, if you're using a big int increments id instead of uuid for your user id you can change the type for the feed_user in {date_string_identifier}_create_feed_user_table.php like so:
->
And then run as you otherwise would have done. This would in this example prevent foreign key constraint issues.
Set-up Complete!
And as far as initial set-up, that's it! You're ready to go.
About Other Feed Types
Adding another feed type such as Atom to the feed application should be relatively simple.
Publish your Larafeed config file and then add the feed type to the config array. It's important to get the values here correct for fetching data from our Dom Document, Elements and Nodes.
For example:
The rest involves a little bit of coding. For example, support the Atom type by adding a new Feed and Entry object to the folders e.g. .
How to Add Feed Types
There are two options (and probably more besides.)
1- Add Feed and Entry classes to your main project and reference them in the published larafeed.php config.
2- OR fork Larafeed and add the classes to your forked project.
Adding Entry and Feed Classes to Main Project
Create Feed and Entry classes
First, add your classes to your main project(not the package), this can be anywhere that makes sense to your project, but for the example we will add these new feed classes to the folder .
You will need two classes:
with the namespace:
with the namespace:
It's important to include the -correct- namespaces so that composer can autoload our new Entry and Feed types correctly and so that the package will know where to look for them.
Remember in this example we're adding Atom feeds to the main application and not the package itself.
Important: Tell composer how to find the new package files
In your MAIN application composer.json your autoload specification should appear as below:
Run:
Add your new type to the accepted-types config
Finally, all you need to do is add your new Feed type to the 'accepted-types' config as outlined further down in this document. You will need to publish the package config to your main application config files.
And choose .
Feed Type Installation Complete!
And that's it! You should now be able to add any Feed type to the package using the above steps.
To see this in action in a fresh Laravel install, take a look at:
https://github.com/eftersom/larafeed-example
In this blank basic Laravel install you can see how Atom feeds can be added to the project for the package to discover. Take a look at the app/Packages folder, composer.json and also the larafeed.php config file found within the main application. It really is as simple as that!
Forking Larafeed
If you would prefer not to complete the previous steps then forking is always an option.
Add extra feed types to the package by forking it and then include further feed types directly within the forked package. Forking is a clean way to change the package whilst also allowing the merging of additional updates from the package author/authors.
Changing your accepted-types configuration
Don't forget to change your Larafeed configuration by adding the new Atom accepted type and that's it! You're ready to go, the service for Larafeed should handle the new feed type dependant on how you've configured your Entry and your Feed objects.
Updates
The current version of the package is listed at the top of this document.
Planned updates are as follows:
- Vueification of the frontend. Optimisation, utilising vuex component loading for quicker page load times.
- Larafeed-social: share feeds and allow a user to set their feed to public or private. Currently all user feeds are public to all web facing users.
- Allow users to have multiple feeds.
- Include more feed types in base package.
License
Larafeed is open source, please refer to MIT license.
All versions of larafeed with dependencies
laravel/framework Version ^6.0|^7.0|^8.0|^9.0
stevebauman/purify Version ^5.0