PHP code example of larawire-garage / larapex-livewire

1. Go to this page and download the library: Download larawire-garage/larapex-livewire library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

larawire-garage / larapex-livewire example snippets


php artisan vendor:publish --tag=larapex-livewire-configs

php artisan vendor:publish --tag=larapex-livewire-assets

// layouts.app.blade.php
<body>
    <!-- Your layout HTML content -->

    @yield('scripts')

    @stack('lw_scripts')
</body>
@larapexScripts

// posts.stats.blade.php [normal or livewire component blade]
<div>
    <!-- Your Sub Page HTML content -->

    @larapexScripts
</div>

php artisan make:larapex YOUR_CHART_CLASS_NAME

private function getData(){
    // Data generating logic
}

public function build()
{
    $this->chart = (new WireableAreaChart($this->chart_id))
        ->addArea('sample-1', $this->getData());
}