Download the PHP package renatoxm/laravel-ticket without Composer

On this page you can find all versions of the php package renatoxm/laravel-ticket. 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-ticket

Laravel-ticket

Backend API to handle your ticket system.

Latest Version on Packagist Tests StyleCI Total Downloads

Introduction

Laravel Ticket package, is a Backend API to handle your ticket system, with an easy way. It was forked from CoderFlex Laravel-ticket and refactored to allow model updates and be more flexible to match your app requirements.

Main differences:

Installation

You can install the package via composer:

Configuration

You can publish the config file with:

You can publish and run the migrations with:

Before Running the migration, you may publish the config file, and make sure the current tables does not make a conflict with your existing application, and once you are happy with the migration table, you can run

Preparing your model

Add HasTickets trait into your User model, along with CanUseTickets interface

Model customization

You can copy one or more of the package models to your App/Models folder to customize them to suit your needs. All you need to do is change the class paths in your config/laravel-ticket.php and you are good to go.

Usage

The Basic Usage of this package, is to create a ticket, then associate the labels and the categories to it.

You can associate as many as categories/labels into a single ticket.

Here is an example

Ticket Table Structure

Column Name Type Default
ID integer NOT NULL
UUID string NULL
user_id integer NOT NULL
title string NOT NULL
comment string NULL
priority string low
status string open
is_resolved boolean false
is_locked boolean false
assigned_to integer NULL
created_at timestamp NULL
updated_at timestamp NULL

Comment Table Structure

Column Name Type Default
ID integer NOT NULL
user_id integer NOT NULL
ticket_id integer NOT NULL
comment string NULL
created_at timestamp NULL
updated_at timestamp NULL

Label Table Structure

Column Name Type Default
ID integer NOT NULL
name string NULL
slug string NULL
is_visible boolean false
created_at timestamp NULL
updated_at timestamp NULL

Category Table Structure

Column Name Type Default
ID integer NOT NULL
name string NULL
slug string NULL
is_visible boolean false
created_at timestamp NULL
updated_at timestamp NULL

API Methods

Ticket API Methods

The ticket model came with handy methods to use, to make your building process easy and fast, and here is the list of the available API:

Method Arguments Description Example Chainable
archive void archive the ticket $ticket->archive()
close void close the ticket $ticket->close()
reopen void reopen a closed ticket $ticket->reopen()
markAsResolved void mark the ticket as resolved $ticket->markAsResolved()
markAsLocked void mark the ticket as locked $ticket->markAsLocked()
markAsUnlocked void mark the ticket as unlocked $ticket->markAsUnlocked()
markAsArchived void mark the ticket as archived $ticket->markAsArchived()
closeAsResolved void close the ticket and marked it as resolved $ticket->closeAsResolved()
closeAsUnresolved void close the ticket and marked it as unresolved $ticket->closeAsUnresolved()
reopenAsUnresolved void reopen the ticket and marked it as unresolved $ticket->reopenAsUnresolved()
isArchived void check if the ticket archived $ticket->isArchived()
isOpen void check if the ticket open $ticket->isOpen()
isClosed void check if the ticket closed $ticket->isClosed()
isResolved void check if the ticket has a resolved status $ticket->isResolved()
isUnresolved void check if the ticket has an unresolved status $ticket->isUnresolved()
isLocked void check if the ticket is locked $ticket->isLocked()
isUnlocked void check if the ticket is unlocked $ticket->isUnlocked()
assignTo void assign ticket to a user $ticket->assignTo($user) or $ticket->assignTo(2)
makePriorityAsLow void make ticket priority as low $ticket->makePriorityAsLow()
makePriorityAsNormal void make ticket priority as normal $ticket->makePriorityAsNormal()
makePriorityAsHigh void make ticket priority as high $ticket->makePriorityAsHigh()

The Chainable column, is showing the state for the method, that if it can be chained or not, something like

Ticket Relationship API Methods

The ticket model has also a list of methods for interacting with another related models

Method Arguments Description Example
attachLabels mixed ID, array attributes, bool touch associate labels into an existing ticket $ticket->attachLabels([1,2,3,4])
syncLabels Model/array IDs, bool detouching associate labels into an existing ticket $ticket->syncLabels([1,2,3,4])
attachCategories mixed ID, array attributes, bool touch associate categories into an existing ticket $ticket->attachCategories([1,2,3,4])
syncCategories Model/array IDs, bool detouching associate categories into an existing ticket $ticket->syncCategories([1,2,3,4])
comment string comment add new comment on an existing ticket $ticket->comment('A comment in a ticket')
commentAsUser Model/null user, string comment add new comment on an existing ticket as a different user $ticket->commentAsUser($user, 'A comment in a ticket')

The attachCategories and syncCategories methods, is an alternative for attach and sync laravel methods, and if you want to learn more, please take a look at this link

The commentAsUser accepts a user as a first argument, if it's null, the authenticated user will be user as default.

Ticket Scopes

The ticket model has also a list of scopes to begin filter with.

Method Arguments Description Example
closed void get the closed tickets Ticket::closed()->get()
opened void get the opened tickets Ticket::opened()->get()
archived void get the archived tickets Ticket::archived()->get()
unArchived void get the unArchived tickets Ticket::unArchived()->get()
resolved void get the resolved tickets Ticket::resolved()->get()
locked void get the locked tickets Ticket::locked()->get()
unlocked void get the unlocked tickets Ticket::unlocked()->get()
withLowPriority void get the low priority tickets Ticket::withLowPriority()->get()
withNormalPriority void get the normal priority tickets Ticket::withNormalPriority()->get()
withHighPriority void get the high priority tickets Ticket::withHighPriority()->get()
withPriority string $priority get the withPriority tickets Ticket::withPriority('critical')->get()

Category & Label Scopes

Method Arguments Description Example
visible void get the visible model records Label::visible()->get()
hidden void get the hidden model records Category::visible()->get()

Handling File Upload

This package doesn't come with file upload feature (yet) Instead you can use laravel-medialibrary by Spatie, to handle file functionality.

The steps are pretty straight forward, all what you need to do is the following.

Extends the Ticket model, by creating a new model file in your application by

Then extend the base Ticket Model, then use InteractWithMedia trait by spatie package, and the interface HasMedia:

The rest of the implementation, head to the docs of spatie package to know more.

Event system

All events are located in the Renatoxm\laravel-ticket\Events namespace.

Ticket events

The following events are dispatched as a result of Eloquent events being fired.

Comment events

The following events are dispatched as a result of Eloquent events being fired.

Consuming events

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

MIT. Please see the license file for more information.


All versions of laravel-ticket with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.16.4
illuminate/contracts Version ^10.0|^11.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 renatoxm/laravel-ticket contains the following files

Loading the files please wait ....