Sharp for Laravel: welcome to Show pages.

From list to form — through show.

Philippe Lonchampt
code16
3 min readDec 11, 2019

--

It’s been a long journey since I announced it, but here it is, finally: the “Show page” feature is part of the brand new 4.2.0 release of Sharp for Laravel.

First, the idea behind it: Sharp for Laravel is a kind of admin panel, or content management framework and we prefer to call it. If you are familiar with this tool, you know that we can build Entity Lists (with state management, filters, search, pagination, mass and instance commands, …) to display data, and Forms (with a lot of built-in fields) to update data. And until now, if we needed to display a single entity, we were forced to use a read only form (handled through the authorization system).

The show page is there to fill this gap, adding an optional stage between the List and the Form. Here’s a example taken from Saturn, the sample project of Sharp use for development and as extra documentation (Saturn can be tested online here, with these credentials: admin@example.com / secret):

A few things to notice:

  • Fields are presented into sections, allowing to organize things a bit; at this time, apart from embedded lists (see below), we can display texts, which can be cropped and can contain images, and picture thumbnails.
  • Show pages can handle entity state and instance commands, juste like Lists (see the top right dropdowns).
  • Authorizations, like everywhere else in Sharp, are checked to display commands, edit button, …
  • Show pages can embed full Entity Lists, like “pilots” here, bringing commands, reorder, filters, search, …

I’ll soon write another post, more technical, with code samples to detail some interesting part of the process of building such a Show page. In the meantime, feel free to browse and test the Saturn app code, and/or the documentation.

Introducing Single Show page (and Single Forms)

From there, it seemed important to go a step further and bring a solution to a common issue in Sharp: how to properly handle single resources, like an account parameters section? That’s the purpose of Single Show pages, which can be reached from the main menu, and would display, instead of an Entity List, a Show page for a unique resource in the current session context (meaning, in most cases I can think of, the current user).

Single Show pages are build on top of Show pages and share all its features, and can be linked to Single Forms for the update part. Until I write the second (technical) post on this subject, you can refer to the dedicated documentation to find out more on this.

OK, that’s all for this announcement post; Sharp 4.2 is available now, as an open source project on Github. If you are new to Sharp you can start here, and feel free to comment this post or reach me on twitter.

--

--

Philippe Lonchampt
code16
Editor for

Developer and founder of Code 16, maintainer of Laravel Sharp.