Hi, new here, a question or two?

angophora - 8 months ago

Hi, I have a reasonable bit of PHP/MySQL development under my belt but it's quite "old school" so things like composer, twig, laravel, less etc etc are all a bit new to me. I've installed PyroCMS to play with and have started working through the videos and referring to the docs but hoping someone could help shine some light for me on (these questions may be "dumb" or redundant... I don't know!):

What exactly the boundaries are between Laravel, Streams, and PyroCMS? I mean, are these strictly layered, or...

When you create a module, you define the schema for a set of tables (I think)? This is done in... Streams? I'm just a bit lost on where the tables are defined and queried.

Thank you :)

ryanthompson - 8 months ago

Good questions! And welcome ^_^

PyroCMS and a base Laravel installation only differ in a few ways. The composer.json contents, a couple config files, and this bootstrapping here: https://github.com/pyrocms/pyrocms/blob/master/bootstrap/app.php#L29-L42

Everything Pyro does is 100% done through addons (in the composer.json). And those addons are built / powered by an engine called the Streams Platform.

So with that Laravel and Pyro are not much different at all. You can even drop "pyro" into an existing Laravel app. So within a Pyro install you can use Laravel exactly the same as you normally would PLUS you can build better and faster using the Streams Platform. And of course all of the addons and what they provide. I should really look into making an illustration of it cause it's kinda cool!

ryanthompson - 8 months ago

To answer your second question about Streams / Tables:

Streams represent tables yes. Assignments represent the columns and fields / field types represent the column types.

When you use migrations to scaffold streams you are defining data structures. The Streams Platform keeps the database structurally synced automatically. The Streams Platform also generated models and other services for you which you can use the same as Eloquent models cause that's what they are (with additional stuff).

So if you make a Friends stream you can do $me = FriendModel::first(); just like you normally would in Laravel.

And if you assign a couple relationship field types for mom / dad then you can do $me->mom->first_name; assuming that relation stream has a field assigned named "First Name". If they have an email field you can use decorated field type methods (where streams really starts flexing) like $me->dad->decorated->email->mailto('Email my dad!'); or in a view with twig that might look like {{ me.dad.email.mailto('Email my dad!') }} (you don't have to decorate).

Pyro (or the streams platform literally) does all the scaffolding / generating for you. You just use it / tweak it as needed.

I hope this helps! Let me know if you have any other questions about it - it's a lot to grasp until you use it / see how it feels (which ironically will be very familiar to you if you've used Laravel).

Cheers!