-
-
Notifications
You must be signed in to change notification settings - Fork 90
Component View
Asep edited this page Feb 18, 2023
·
2 revisions
This is how to create a new component.
php artisan module:make-component Card --module=Blog
If it was created successfully then a new component's file will be saved as Modules/Blog/View/Components/Card.php
, after that please add this component to service provider by open \Modules\Blog\Providers\BlogServiceProvider
and see the example below.
. . .
use Modules\Blog\View\Components\Card;
. . .
/**
* Load view component
*
* @return void
*/
protected function registerViewComponent()
{
$this->loadViewComponentsAs('blog', [
Card::class,
]);
}
. . .
If it was registered, then you can call it by add prefix x-blog
before component's name and you can replace 'blog' with your module's name, see the example.
<x-blog-card>
lorem ipsum dolor sit amet
</x-blog-card>
- #1 Create Module
- #2 Create Menu
- #3 Route
- #4 Create DataTables
- #5 Template Layout
- #6 Create Model
- #7 Create Command
- #8 Create Component
- #9 Broadcast Notification
- #10 Group Search
- #11 Flashing Message
- #12 Compiling Assets (ViteJs)
- #13 Ladmin Option
- #14 Utility & Helpers
- #15 Vendor Publish
- #16 Custom Style
- #17 Ladmin Awesome
- #18 Make Money