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: README.md
+61-57
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@
15
15
16
16
## Modular's Blog Module
17
17
18
-
The Modular Blog Module is a Blog Module for Applications built using the [Modular Project](https://docs.ismodular.com).
18
+
The Modular Blog Module is a comprehensive solution for adding a blog to applications built with the [Modular Project](https://docs.ismodular.com).
19
19
20
20
It has the following features:
21
21
@@ -24,13 +24,15 @@ It has the following features:
24
24
- Tags Management
25
25
- Authors Management
26
26
27
-
This means that you can easily create posts using a Fully Featured WYSIWYG Editor, and manage them using a simple and intuitive interface to create, edit, and delete posts, categories, tags, and authors, also allowing you to manage the posts' status and visibility throught publication dates.
27
+
This means that you can easily create posts using a Fully Featured WYSIWYG Editor, and manage them using a simple and intuitive interface to create, edit, and delete posts, categories, tags, and authors, also allowing you to manage the posts' status and visibility through publication dates.
28
28
29
29
## Preparing to install the Modular Blog Module
30
30
31
-
Before installing the Modular Blog Module, you need to make sure that you have the Modular Project installed and configured in your Laravel Application. If you haven't done that yet, you can follow the [Modular Project's Installation Guide](https://docs.ismodular.com/getting-started.html).
31
+
Before installing the Modular Blog Module, please ensure the following steps are completed:
32
32
33
-
With the Modular Project installed, follow the steps to [Publish Site Files](https://docs.ismodular.com/essentials/site-setup.html).
33
+
1.**Modular Project Installation**: Confirm that the Modular Project is installed and configured in your Laravel application. If this step is incomplete, please consult the [Modular Project's Installation Guide](https://docs.ismodular.com/getting-started.html) for assistance.
34
+
35
+
2.**Site Files Publication**: With the Modular Project set up, proceed to [Publish Site Files](https://docs.ismodular.com/essentials/site-setup.html) as outlined in the documentation. This step is crucial for successfully integrating the Modular Blog Module.
34
36
35
37
Now that you have all set, proceed to install the Modular Blog Module.
36
38
@@ -42,81 +44,57 @@ To install the Modular Blog Module, you need to require it using Composer:
42
44
composer require daniel-cintra/modular-blog
43
45
```
44
46
45
-
After that, you can run the module's installation command:
47
+
Then, initiate the module installation:
46
48
47
49
```bash
48
50
php artisan modular:blog-install
49
51
```
50
52
51
-
This command will publish the module's files required for the module to work, and also run the module's migrations and optionally seed the database with some default data.
53
+
This action publishes essential files and runs migrations, with an option to seed the database with default data.
54
+
55
+
```bash
56
+
php artisan storage:link
57
+
```
52
58
53
59
### Check npm dependencies
54
60
55
-
The Blog Module has a dependency on the Pinia npm package. If you don't have it installed, follow these steps:
61
+
The Blog Module has a dependency on the [Pinia Store](https://pinia.vuejs.org/)npm package. If you don't have it installed in your project, follow these steps:
56
62
57
63
1 - On your project root run:
58
64
59
65
```bash
60
66
npm install -D pinia
61
67
```
62
68
63
-
2 - Open the file `resources/js/app.js` and add the pinia`import { createPinia } from 'pinia'` and the `.use(createPinia())` blocks.
69
+
2 - Open the file `resources/js/app.js` and add the Pinia`import { createPinia } from 'pinia'` and the `.use(createPinia())` blocks.
In `vite.config.js` manually add the module entry to:
147
+
In `vite.config.js` manually add the `resources-site/js/blog-app.js` entry to the laravel plugin `input` array:
170
148
171
149
```js
172
150
plugins: [
@@ -182,21 +160,46 @@ plugins: [
182
160
],
183
161
```
184
162
185
-
That's it. The Blog Module should be fully functional at this stage.
163
+
With the installation steps completed as outlined, the Blog Module should now be fully operational within your application. This marks the completion of the setup process, enabling you to start using the module's features for managing and publishing blog content.
164
+
165
+
### Compiling the assets
166
+
167
+
To view the changes on your project run:
168
+
169
+
```bash
170
+
npm run dev
171
+
```
172
+
173
+
#### Blog CMS
174
+
175
+
To access the Blog Module's CMS (Content Management System), login in to the Modular CMS using the configured path in your `config/modular.php` file in the `login-url` key (for example `/admin`). The Blog Management links will be listed in the sidebar menu.
176
+
177
+
<imgsrc="art/modular-blog-cms.jpg"alt="Modular Blog Index"style="width: 100%;">
178
+
179
+
#### Blog Site View
180
+
181
+
By default, you can access the blog posts controller in the `/blog` route registered by the module.
182
+
183
+
<imgsrc="art/modular-blog-index.jpg"alt="Modular Blog Index"style="width: 100%;">
186
184
187
185
### Blog Seeders (Optional Step)
188
186
189
-
The Blog Module has two built in Seeders:
187
+
The Blog Module includes two built-in seeders:
188
+
189
+
1.**BlogSeeder**: This seeder populates your database with `posts`, `authors`, `categories`, and `tags`. It also fetches images online to enrich `posts`, `authors`, and `categories`. Since it retrieves images from the internet, the seeding process may take a few seconds. A progress bar indicator is included within the Seeder, allowing you to monitor the progress of the operation.
190
+
191
+
2.**BlogAclSeeder**: This seeder creates the Access Control List (ACL) Permissions related to the Blog Module. These permissions can then be associated with the desired `ACL Role` through the application's interface, facilitating the management of user permissions within the blog module.
190
192
191
-
1 - **BlogSeeder**: Will create `posts`, `authors`, `categories` and `tags`. It will fetch images online to populate `posts`, `authors` and `categories`, so it can take a few seconds to complete.
193
+
You have the option to manually run the seeders or include them in the `database/seeders/DatabaseSeeder.php` file for automatic execution. This flexibility allows you to tailor the seeding process to your application's needs, ensuring that the Blog Module is populated with initial data or configured with the necessary ACL permissions as part of your project's overall database seeding strategy.
192
194
193
-
2 - **BlogAclSeeder**: Will create the ACL Permissions associated with the module, so it can be associated with the desired `ACL Role` through the App Interface.
195
+
#### Adding the Seeders to the DatabaseSeeder File
194
196
195
-
You can manually run the seeders or you can add the seeders to be executed in the `database/seeders/DatabaseSeeder.php` file.
197
+
To integrate the seeders with your application's seeding process, add them to the `DatabaseSeeder.php` file located in `database/seeders`. Here's how to do it:
196
198
197
-
#### Adding the seeders to the DatabaseSeeder file
199
+
1. Import the `BlogSeeder` and `BlogAclSeeder` at the top of your `DatabaseSeeder.php` file.
200
+
2. Inside the `run` method of your `DatabaseSeeder`, invoke the seeders by calling their respective `run` methods.
198
201
199
-
To add the seeders to the main DatabaseSeeder file, import the BlogSeeders and call them inside the `run` method:
202
+
This setup ensures that when you run the database seeding command, both the BlogSeeder and BlogAclSeeder are executed, populating your database with initial blog data and setting up ACL permissions accordingly.
200
203
201
204
```php
202
205
<?php
@@ -212,23 +215,24 @@ public function run(): void
212
215
$this->call(BlogAclSeeder::class);
213
216
$this->call(BlogSeeder::class);
214
217
}
215
-
216
218
```
217
219
218
220
#### Manually executing the Seeders
219
221
220
-
To manually execute the Seeders you can run:
222
+
To manually run the seeders, execute the following commands in your terminal:
These commands allow you to selectively seed your database with the blog module's content and ACL permissions, offering a more controlled setup process.
0 commit comments