You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/digging-deeper/collections.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,19 +8,19 @@ navigation:
8
8
9
9
## Introduction to Hyde Data Collections
10
10
11
-
Hyde provides `DataCollections`, a subset of [Laravel Collections](https://laravel.com/docs/10.x/collections) giving you
12
-
a similar developer experience to working with Eloquent Collections. However, instead of accessing a database,
13
-
it's all entirely file-based using static data files such as Markdown, Yaml, and JSON files which get
11
+
Hyde provides `DataCollections`, a subset of [Laravel Collections](https://laravel.com/docs/10.x/collections) giving you a similar developer experience to working with Eloquent Collections.
12
+
However, instead of accessing a database, it's all entirely file-based using static data files such as Markdown, Yaml, and JSON files which get
14
13
parsed into objects that you can easily work with.
15
14
16
-
As you have access to all standard Laravel Collection methods, you are encouraged to read the
17
-
[Laravel Collections documentation](https://laravel.com/docs/10.x/collections) for more information.
15
+
As you have access to all standard Laravel Collection methods, you are encouraged to read the [Laravel Collections documentation](https://laravel.com/docs/10.x/collections) for more information.
18
16
19
17
This article covers advanced usage intended for those who are writing their own Blade views, and is not required as Hyde comes pre-packaged with many templates for you to use.
20
18
21
19
22
20
## High-Level Concept Overview
23
21
22
+
In short, HydePHP finds files in the specified directory, turns each file into an object, and returns a Laravel Collection of these objects.
23
+
24
24
To make collections easy to use and understand, Hyde makes a few assumptions about the structure of your collections.
25
25
Follow these conventions and creating dynamic static sites will be a breeze.
26
26
@@ -29,7 +29,7 @@ Follow these conventions and creating dynamic static sites will be a breeze.
29
29
3. To get a collection, specify name of the subdirectory the files are stored in.
30
30
4. Data will be parsed into differing objects depending on which facade method you use. See the table below.
31
31
5. The class is aliased so that you can use it in Blade files without having to include the namespace.
32
-
6. While not enforced, each subdirectory should probably only have the same filetype to prevent developer confusion
32
+
6. While not enforced, each subdirectory should probably only have the same filetype to prevent developer confusion.
33
33
7. Unlike source files for pages, files starting with underscores are not ignored.
34
34
8. You can customize the source directory for collections through a service provider.
35
35
9. If the base source directory does not exist, it will be created for you.
0 commit comments