Download the PHP package mnaimjons/laravel-stories without Composer

On this page you can find all versions of the php package mnaimjons/laravel-stories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-stories

Laravel Stories Package

Latest Version on Packagist Total Downloads License

The Laravel Stories Package provides "stories" functionality for any model in your Laravel application, similar to how it's implemented in social media platforms. The package supports:

Note: In the current version, all stories are visible to all users. Future releases will include privacy settings.

Table of Contents

Installation

  1. Install the package via Composer:

  2. Publish and run the migrations:

  3. Publish the configuration:

  4. Install Spatie Media Library (if not already installed):

Configuration

The configuration file config/stories.php contains the package settings:

You can change the default story expiration time by modifying the default_expiration value.

Usage

Adding the Trait to Your Model

Add the HasStoriesTrait trait and implement the HasStories interface in the model you want to associate stories with (e.g., the User model):

Creating Stories

You can create stories for any model that uses the HasStoriesTrait. Here's an example of creating a story for the currently authenticated user:

Note: Ensure your form includes a file input field named media and has the multipart/form-data encoding type.

Viewing Stories

Retrieve active stories for a user:

Adding Comments

Users can leave comments on stories:

Or through a controller:

Adding Reactions

Users can react to stories (e.g., send emojis):

If a user has already reacted to this story, their reaction will be updated.

Tracking Views

Each time a user views a story, you can record the view:

Or automatically when displaying stories via a controller:

API Routes

The package provides a set of API routes for working with stories. The routes are defined in routes/api.php and are automatically loaded by the service provider.

List of Routes

Method Route Action
POST /stories Create a new story
GET /stories Get a list of active stories
GET /stories/{id} View a specific story
POST /stories/{id}/comment Add a comment to a story
POST /stories/{id}/react Add or update a reaction to a story

API Usage Examples

Creating a Story

Getting Active Stories

Adding a Comment

Adding a Reaction

Scheduling Tasks

To automatically delete expired stories and associated media files, add the cleanup command to your task scheduler in app/Console/Kernel.php:

The stories:cleanup command deletes all stories that have expired and cleans up associated media collections.

Customization

Adjusting Story Expiration Time

You can change the default story expiration time by modifying the default_expiration value in config/stories.php:

Extending Models

If you need to extend the functionality of the package's models (e.g., Story, StoryComment, StoryReaction), you can create your own models and configure the package to use them.

Adding Privacy Settings

In the current version, all stories are visible to all users. You can extend the package by adding privacy settings to the Story model and updating access policies.

Testing

It is recommended to cover your code with tests to ensure the package works correctly in your application.

Example Test

License

The package is open-sourced software licensed under the MIT license.

Contact

Thank You

Feedback

If you have any questions or suggestions, please create an issue on GitHub or submit a Pull Request.

Conclusion

The Laravel Stories Package provides a powerful and flexible way to add stories functionality to your application. It integrates easily with existing models and allows users to interact through stories, comments, and reactions.

Start using it today to enhance user engagement in your application!

Key Features

Requirements

Development Installation

  1. Clone the repository:

  2. Install dependencies:

  3. Link the package in your application:

    In your application's composer.json, add:

    Then require the package:

Contribution

We welcome contributions from the community! If you'd like to contribute to the development of the package, please:


Thank you for using the Laravel Stories Package!



All versions of laravel-stories with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
illuminate/support Version ^8.0|^9.0|^10.0
spatie/laravel-medialibrary Version ^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mnaimjons/laravel-stories contains the following files

Loading the files please wait ...