statamic-rad-pack / runway Goto Github PK
View Code? Open in Web Editor NEWEloquently manage your database models in Statamic.
Home Page: https://statamic.com/addons/rad-pack/runway
License: MIT License
Eloquently manage your database models in Statamic.
Home Page: https://statamic.com/addons/rad-pack/runway
License: MIT License
Show specific BelongsTo field in Listing for example:
\App\Models\Booking::class => [
'name' => 'Bookings',
'blueprint' => [
'sections' => [
'main' => [
'fields' => [
/*
[
'handle' => 'title',
'field' => [
'type' => 'text',
'validate' => 'required',
],
],
*/],
],
'sidebar' => [
'fields' => [
[
'handle' => 'property_id',
'field' => [
'type' => 'belongs_to',
'resource' => 'property',
'max_items' => 1,
'mode' => 'select',
'validate' => 'required',
],
]
]
]
],
],
'listing' => [
'columns' => [
'id',
'property_id'
],
'sort' => [
'column' => 'id',
'direction' => 'asc',
],
'cp_icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" class="bi bi-calendar-range" viewBox="0 0 16 16">
<path d="M9 7a1 1 0 0 1 1-1h5v2h-5a1 1 0 0 1-1-1zM1 9h4a1 1 0 0 1 0 2H1V9z"/>
<path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/>
</svg>',
],
],
It would be good to have some use cases listed in the READMe
There's a couple of improvements I'd like to make to the index listing:
I still need to investigate how this would work behind the scenes, especially with the filters..
Will probably need to convert the index listing from Blade to Vue so I can do the real-time-ness that's required for some of the features.
Where you want to use Runway as a replacement for entries.
It might be a good idea to provide some screenshots on the Marketplace listing of Runway.
When I try to edit a model in my resource, the screen goes white after a few seconds. Presumably to do with something we're doing with custom publish forms.
Statamic 3.1.16 Pro
Laravel 8.43.0
PHP 8.0.3
aryehraber/statamic-captcha 1.5.1
doublethreedigital/duplicator 1.3.2
doublethreedigital/runway 2.0.2
octoper/statamic-html-minify 0.0.5
I have Orphans
that have many OrphanUpdates
via the updates()
relationship:
<?php
namespace App\Models;
use App\Models\Country;
use App\Models\OrphanUpdate;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Orphan extends Model
{
use HasFactory;
public function country()
{
return $this->belongsTo(Country::class);
}
public function updates() {
return $this->hasMany(OrphanUpdate::class);
}
}
Would be great if I could do this:
{{ runway:orphan where="id:{orphan}" }}
DETAIL PAGE
<img src="{{ image }}">
<h2>{{ name }}</h2>
<p>{{ summary }}</p>
<h3>Updates</h3>
<ul>
{{ updates }}
<li>
{{ text }}
</li>
{{ /updates }}
</ul>
{{ /runway:orphan }}
query the orphanupdate
resource directly.
This is just a nice to have. I can deal without.
When I install Runway I'm somehow unable to delete any entries, taxonomies, or assets. The delete buttons are removed from tables and action dropdown. I can still delete blueprints and fieldsets.
If I uninstall Runway the delete buttons come back. I have tried different combinations of Runway and Statamic versions, but they all give the same result.
Statamic 3.2.4 Solo
Laravel 8.61.0
PHP 7.4.12
doublethreedigital/runway 2.1.21
It would be nice for this addon to bring support for the Statamic Content API.
If we implement #54, it makes sense we introduce this as well.
You could build your own API endpoints with Resources and just get the data out that way.
This is just a nice to have. I can deal without.
Possibility to export the entries to csv.
I think it could be a good idea to show a search form on the listing table for search.
For Bard etc, you'll need the column to be JSON and cast to JSON in your Eloquent model. I should probably add documentation around this.
I'd like for Runway models to provide their own front-end routes so they act just like collections.
We may be able to achieve this by adding our own repository to this list... https://github.com/statamic/cms/blob/3fab3f0d3b8600da6e597e6a8bb0d63e70502e21/src/Providers/AppServiceProvider.php#L106
^ that list is used for the Data
facade which is whats used for content lookups in the FrontendController
, so in theory adding a custom repo in there and some other bits and bobs should get us pretty close to a prototype.
If this is something you'd like to see added, please leave a ๐ reaction to this issue.
This could be nice if you had a table of orders and you don't want any users to delete any orders due to them needing to be kept for legal purposes.
I have an existing model that uses the Spatie/Sluggable package, and uses the getRouteKeyName() method to set a custom route key: 'slug'. The listing page of Runway uses the 'id' field to generate the edit link (eg. http://localhost/cp/runway/product/1), but the Resource Controller edit method uses the routeKey() method in retrieving the model record. So it is trying to find a record whose slug is '1'. This results in an "Attempt to read property "name" on null" error, since the record cannot be retrieved.
Statamic 3.1.27 Solo
Laravel 8.42.1
PHP 8.0.7
doublethreedigital/runway 2.1.1
It would be nice if Runway provided a fieldtype for each of the models the developer publishes so devs can link to Eloquent records in entries or whatever.
Hi, it seems that you've commented out in the ListingView.vue
component the support for Bulk Actions, while in the documentation you refer to it as doable.
Is there any incombatibility?
Thanks
No response
Statamic latest version + your latest version on php 8.0
My use case:
OprhanUpdate
modelsince(...carbon...)
query scope that returns updates since a given dateI'd love to be able to run that query scope (and potentially more than one query scope) in Antlers like so:
{{ runway:orphanupdate scope="since:some_date" where="...." }}
Should also support multiple query scopes, perhaps like scopes="since:some_date|another_scope"
?
custom modifiers
This is just a nice to have. I can deal without.
Have the eloquent models that are used inside runway accessible by the search index.
This on its turn would make them available in the site wide search, if algolia is configure they'd move into there as well I think?
And using the search index on the frontend would also make them accessible there.
Adding the models to searchables would open them up to a lot of places!
Not really no
I could share some classes from the Statamic core I looked into when I tried extending it myself.
But I think you'd get there quite easily. Like discussed on discord did would probably need changes in the statamic core.
When using the provided tag, the ID or any other non-augmented fields for that matter are not available in Antlers for the developer to use.
Try to reference an {{ id }}
while looping with the Runway tag.
I expected the non-augmented fields to be available, just not augmented, obviously.
Statamic 3.0.34 Pro
Laravel 8.18.1
PHP 7.4.3
doublethreedigital/runway dev-master
statamic/ssg 0.2.0
For some reason, when you're using the Asset fieldtype on a resource and you attempt to use it as if it's augmented in a front-end template, it doesn't show:
Runway, after #28
Whenever you use the slug fieldtype in a blueprint, it will cause an error which gets rid of the text field altogether. I believe it's something to do with stuff in the Vuex store.
Runway, after #30
Might be nice if we could create an integration with Blaze so we can kinda cross-promote that addon.
Build my own, rely on the CP Nav Item search thingy?
This is just a nice to have. I can deal without.
The new HasMany Fieldtype is great, thanks for this.
For our use case we'd like one of 2 things:
Nope, for our use case we can't use this field.
This is sort of a blocker for me/this project.
As title states, when on edit/create model pages it would be great if the native Statamic cmd-s would create and redirect / save.
Yes - just click button with the mouse.
This is just a nice to have. I can deal without.
I have a date field (sql type date
) with this in the blueprint:
handle: birthdate
field:
mode: single
time_enabled: false
time_required: false
earliest_date: '1900-01-01'
full_width: false
inline: false
columns: 1
rows: 1
display: Birthdate
type: date
icon: date
When I try to load a model detail page in the CP I get a carbon error:
Statamic 3.2.16 Pro
Laravel 8.64.0
PHP 8.0.11
aryehraber/statamic-captcha 1.5.2
aryehraber/statamic-uuid 2.0.3
doublethreedigital/runway 2.1.27
edalzell/download dev-main
edalzell/forma 1.0
jonassiewertsen/statamic-livewire 2.7.0
statamic/seo-pro 2.3.2
transformstudios/events 2.2.2
transformstudios/front 1.7.1
transformstudios/gated dev-main
transformstudios/magic-link dev-main
transformstudios/memorial dev-feature/orphan-portal
transformstudios/price-of dev-feature/orphan-portal
transformstudios/review 3.1
transformstudios/simple dev-main
transformstudios/stripe dev-main
transformstudios/takeover-redirects dev-main
Once #46 is merged, I think it would be a good time to get rid of our custom listing buttons system and use Actions instead.
Just continue to use listing buttons ๐คทโโ๏ธ
I'm going to need it at some point in the future but it's not major right now.
This is something I've told a couple of people about but essentially, my plan at some point is to build a way to automatically generate database migrations, based on field configurations from your blueprint.
It would be smart enough to know which column type each builtin fieldtype should be and it would be clever to change that if max_assets
is defined.
If we don't know which column type to use (eg. custom fieldtype) we could maybe just leave it as a string/json column and give the user an error?
This would be some sort of command, like: php please runway:migration order
You could just do it by hand, which is a bit of a sucky option because you then have to define everything twice.
This is just a nice to have. I can deal without.
Be able to use Statamic GUI to view and edit runway blueprints from the CP. I assume that is what this idea is about: statamic/ideas#408
Yep - just do it manually.
Yes.
When I save a Bard field the contents of the field in the edit screen is still json.
config\runway.php
'resources' => [
\App\Models\MyModel::class => [
'name' => 'My Model',
'hidden' => true,
// 'icon' => '',
'blueprint' => [
'sections' => [
'main' => [
'fields' => [
[
'handle' => 'title',
'field' => [
'type' => 'text',
'validate' => 'required',
],
],
[
'handle' => 'body',
'field' => [
'type' => 'markdown',
'validate' => '',
],
],
[
'handle' => 'images',
'field' => [
'type' => 'assets',
'container' => 'assets',
'validate' => '',
],
],
[
'handle' => 'bard_content',
'field' => [
'always_show_set_button' => false,
'buttons' => [
'h2',
'h3',
'bold',
'italic',
'unorderedlist',
'orderedlist',
'removeformat',
'quote',
'anchor',
'image',
'table',
],
'save_html' => false,
'toolbar_mode' => 'fixed',
'link_noopener' => false,
'link_noreferrer' => false,
'target_blank' => false,
'reading_time' => false,
'fullscreen' => true,
'allow_source' => true,
'enable_input_rules' => true,
'enable_paste_rules' => true,
'display' => 'Standard Bard Field',
'type' => 'bard',
'icon' => 'bard',
'listable' => 'hidden',
],
],
],
],
],
],
'listing' => [
'columns' => [
'title',
],
'sort' => [
'column' => 'title',
'direction' => 'asc',
],
]
],
database\migrations\2021_06_26_211029_create_my_models_table.php
Schema::create('my_models', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('body')->nullable();
$table->json('images')->nullable();
$table->json('bard_content')->nullable();
$table->timestamps();
});
app\Models\MyModel.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class MyModel extends Model
{
use HasFactory;
// protected $guarded = [];
protected $casts = [
'bard_content' => 'json',
];
}
Statamic 3.1.26 Solo
Laravel 8.48.2
PHP 7.4.19
doublethreedigital/runway 2.0.5
It would be good to have a php please runway:blueprint Order
. Where the schema of the model could be mapped, or best guessed, to a fieldtype and generate a blueprint based on that.
So that when statamic/cms#3963 is hopefully merged, you can go and make the amendments to the blueprint but the skeleton would be there to modify.
Yep. Manually look up the column type -> fieldtype pairing and write the blueprint array.
This is just a nice to have. I can deal without.
Runway should respect the getRouteKey
method on Eloquent models which defines the model key used in URLs. This is helpful in large applications where you don't want to expose incrementing IDs to the end user.
Add this method to an Eloquent model and try to visit a Runway edit publish form. It uses the record ID. (Note to self: see on pod project)
public function getRouteKey()
{
return 'uuid';
}
I expected that the URL would use the UUID value, instead of the incrementing id.
Statamic 3.0.34 Pro
Laravel 8.18.1
PHP 7.4.3
aryehraber/statamic-captcha 1.1.0
doublethreedigital/runway 1.0.1
If you create a new model from e.g. https://statamic-runway-demo.test/cp/runway/mymodel/create
Chrome throws a dirty state warning ( I assume because of the pending redirect ):
Statamic 3.1.26 Solo
Laravel 8.48.2
PHP 7.4.19
doublethreedigital/runway 2.0.5
To change models.
to resources.
when upgrading to v2.0 of Runway.
Runway provides a delete action on records but it would be nice if there was a confirmation modal that comes up as part of that so a user doesn't accidentally delete the wrong record.
Lots of people recently have been asking for Runway to add support for Live Preview.
When you update values of a record in the control panel, when they are submitted back, we don't seem to do any sort of validation on them.
Use case:
Orphan
which hasMany
OrphanUpdate
s via a updates
relationshipsponsorUpdates
relationship on Orphan
Would like to be able to use that relationship in the {{ runway:orphan ... }}
like so:
{{ runway:orphan with="sponsor_updates" ... }}
{{ sponsor_updates }}
...
{{ /sponsor_updates }}
Likely a custom modifier or tag
This is sort of a blocker for me/this project.
Currently using Runway to build out an orphan sponsorship feature. The customer signs up for a sponsorship, indicating their preferences (gender, country, etc). First pass will be a manual process to find the most appropriate orphan, and do that we need to be able to filter on fields (like gender, country) to find the best one.
Not really, can only do a single column sort
This is sort of a blocker for me/this project.
I'm trying to deploy a project with Runway to a new Forge server but I'm running into issue when I run composer install
, either from inside Forge or via SSH. Here's the output:
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Illuminate\Database\QueryException
SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select column_name as `column_name` from information_schema.columns where table_schema = homestead and table_name = payments)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678
674โ // If an exception occurs when attempting to run a query, we'll format the error
675โ // message to include the bindings with SQL, which will make this exception a
676โ // lot more helpful to the developer instead of just the database's errors.
677โ catch (Exception $e) {
โ 678โ throw new QueryException(
679โ $query, $this->prepareBindings($bindings), $e
680โ );
681โ }
682โ
1 [internal]:0
DoubleThreeDigital\Runway\Support\ModelFinder::DoubleThreeDigital\Runway\Support\{closure}()
+2 vendor frames
4 [internal]:0
DoubleThreeDigital\Runway\Support\ModelFinder::DoubleThreeDigital\Runway\Support\{closure}()
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Install the pman project on forge (I know the one)
For the install process to work absolutely fine.
Can't run command so unsure.
For headless sites with lots of entries, this could be the killer feature thats currently missing in Statamic. Being able to store some Collections in a database would be the perfect solution.
Would be great to be able to enable GraphQL for certain models. Sometimes we just add models that just hold data and shouldn't be publicly queryable.
Not that I can think of, is the data available in the content api?
I'm going to need it at some point in the future but it's not major right now.
I have a resource OrphanUpdate
. When used in a template I need to do {{ runway:orphanupdate ... }}
instead of {{ runway:orphan_update ... }}
like I'd expect.
FooBar
{{ runway:foo_bar ... }}
Statamic 3.1.32 Pro
Laravel 8.53.1
PHP 8.0.9
aryehraber/statamic-captcha 1.5.2
aryehraber/statamic-uuid 2.0.3
doublethreedigital/runway 2.1.5
edalzell/forma 0.8.12
jonassiewertsen/statamic-livewire 2.6
statamic/seo-pro 2.2.1
transformstudios/events 2.2
transformstudios/front 1.2.1
transformstudios/magic-link dev-main
transformstudios/memorial dev-feature/orphan-portal
transformstudios/price-of dev-feature/orphan-portal
transformstudios/review 3.1
transformstudios/simple dev-main
transformstudios/stripe dev-main
transformstudios/takeover-redirects dev-main
HasMany, HasOne etc.
Not sure.
This is just a nice to have. I can deal without.
It would be really useful, particularly on big blueprints, to target a specific field with an "invalid" UI treatment.
Yes you can just look for the field with an asterisk that is not filled in.
This is just a nice to have. I can deal without.
Add the instructions to the changelog of v2.0.0 so users know what they need to do. Similarly to what we did for Simple Commerce.
https://github.com/doublethreedigital/runway/releases/tag/v2.0.0
I know what I mean.
If you have assigned a route to a resource, it would be great to have a button on the edit entry page to visit the URL, like in standard Statamic.
Just remember the route.
This is just a nice to have. I can deal without.
We've got an app where we're using Runway for the front-end marketing site and we're using Inertia.js in the backend for the web app.
It seems like whenever the Responsable
interface is on a model, it causes Inertia.js to break, causing the below error:
Statamic 3.1.32 Pro
Laravel 8.54.0
PHP 7.4.13
doublethreedigital/duplicator 1.3.3
doublethreedigital/runway 2.1.5
doublethreedigital/simple-commerce 2.3.18
Pretty much every single state a fieldtype could be in just doesn't seem to work, which is odd. There are listingColumns
available.
Loom: https://www.loom.com/share/06afe9eb80d442fea6429c2cacd78fdf
No response
Latest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.