Download the PHP package jgawlik/laravel-journal without Composer

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

Laravel Journal

CI Latest Version

A private, per-user journal JSON API for Laravel: posts, categories and tags, with search, sorting and pagination.

Requirements

Installation

The service provider is auto-discovered.

If your user model is not App\Models\User, publish the config and set user_model before migrating. The migration uses it to create foreign keys of the matching type.

Optionally, seed a few starter categories (Personal, Work, Travel, Ideas, Learning):

Publishing the migrations

The migrations run straight from the package by default. To customise them, publish them and turn off the package's own copy, or they will run twice:

Authentication

Routes use the api and auth:sanctum middleware by default. Sanctum is not installed by this package, so either install it (php artisan install:api) or point routes.middleware at another guard:

Managing categories

Anyone signed in can list and view categories, but creating, updating and deleting them is denied until you define the gate, for example in AppServiceProvider::boot():

Configuration

Key Default Description
routes.enabled true Set to false to register the routes yourself.
routes.prefix api/journal URL prefix for every endpoint.
routes.middleware ['api', 'auth:sanctum'] Middleware for every endpoint. It must authenticate the user.
routes.name journal. Route name prefix, e.g. journal.posts.index.
user_model App\Models\User The model that owns posts and tags.
run_migrations true Set to false after publishing the migrations.
pagination.per_page 15 Default page size.
pagination.max_per_page 100 Largest per_page a client may request.

If you register the routes yourself, keep the route parameter names post, category and tag.

API

All endpoints are relative to the prefix (/api/journal by default) and return JSON.

Method Endpoint Description
GET /posts List your posts
POST /posts Create a post
GET /posts/{id} Show a post
PUT/PATCH /posts/{id} Update a post
DELETE /posts/{id} Delete a post
GET /tags List your tags
POST /tags Create a tag
GET /tags/{slug} Show a tag
PUT/PATCH /tags/{slug} Update a tag
DELETE /tags/{slug} Delete a tag (it is removed from its posts)
GET /categories List categories
POST /categories Create a category (gated)
GET /categories/{slug} Show a category
PUT/PATCH /categories/{slug} Update a category (gated)
DELETE /categories/{slug} Delete a category (gated; its posts become uncategorised)

Listing

Every list endpoint accepts:

Parameter Description
search Case-insensitive match on title and content (posts) or name and slug (tags, categories).
sort Posts: title, created_at, updated_at. Tags and categories: name, slug, created_at, updated_at. Default created_at.
direction asc or desc. Default desc.
per_page Page size, up to pagination.max_per_page.
page Page number.

/posts also accepts category and tag, each a slug (lowercase letters, numbers and single hyphens).

Responses are standard Laravel paginated resources, with data, links and meta.

Posts

Field Rules
title Required on create. Up to 255 characters.
content Required on create.
slug Optional. Lowercase letters, numbers and single hyphens, unique among your posts. Generated from the title on create (my-day, my-day-2, …) and never changed automatically.
cover_image Optional http/https URL, up to 2048 characters.
category_id Optional ID of an existing category, or null.
tags Optional array of up to 20 tag names. Missing tags are created for you. Names are matched by their slug, so Road Trip and road trip are the same tag, and a name that has no letters or digits once transliterated to ASCII (for example !!!) is skipped. On update, the list replaces the post's tags, and [] or null removes them all.

Tags and categories

Both take a name (required on create; up to 50 characters for tags, 255 for categories) and an optional slug, which is generated from the name when left out. Tag slugs are unique per user, and category slugs are unique globally.

On list and show, both include posts_count. For categories, it counts only your own posts.

Status codes

Code When
401 Not authenticated.
403 Managing categories without the gate.
404 The record doesn't exist or belongs to another user.
422 Validation failed.

Testing

Changelog

See CHANGELOG.md.

License

MIT. See LICENSE.


All versions of laravel-journal with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^12.0|^13.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 jgawlik/laravel-journal contains the following files

Loading the files please wait ...