Package Data | |
---|---|
Maintainer Username: | teepluss |
Maintainer Contact: | teepluss@gmail.com (Teepluss) |
Package Create Date: | 2015-04-03 |
Package Last Update: | 2015-07-28 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:17:45 |
Package Statistics | |
---|---|
Total Downloads: | 222 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Component is used to separate small parts from the main view and still works perfectly.
To get the latest version of Theme simply require it in your composer.json
file.
"teepluss/component": "dev-master"
You'll then need to run composer update
to download it and have the autoloader updated.
In your config/app.php
add 'Teepluss\Component\ComponentServiceProvider'
to the end of the providers
array:
'providers' => [
...
'Teepluss\Component\ComponentServiceProvider',
]
Publish Configuration
php artisan vendor:publish --provider="Teepluss\Component\ComponentServiceProvider"
Using artisan CLI to create a component, then you can found your component into app/Components
.
php artisan component:make LiveChatBox
The command will generate a structure like this:
root
|- app
|--- Components
|----- LiveChatbox
|------- assets
|--------- css
|------------ style.css
|--------- img
|--------- js
|------------ script.js
|------- lang
|--------- en
|------------ messages.php
|------- views
|--------- index.blade.php
|------- LiveChatbox.php
|----- gulp.js
{!! component()->uses('LiveChatBox', ['args' => '1'])->render() !!}
Install gulp
npm install gulp
Using gulp to publish component assets.
$ cd app/Components/
$ gulp
$ gulp watch
Render all component scripts and styles from the main layout
// Display component scripts and styles.
{!! component()->scripts() !!}
{!! component()->styles() !!}
// Locate to asset path.
{!! component()->uses('LiveChatBox')->asset('img/someimage.png') !!}
Translation
{!! component()->trans('message') !!}
If you have some problem, Contact teepluss@gmail.com