PHP code example of jaxon-php / jaxon-laravel
1. Go to this page and download the library: Download jaxon-php/jaxon-laravel 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/ */
jaxon-php / jaxon-laravel example snippets
Route::get('/', [DemoController::class, 'index'])
->middleware(['web', 'jaxon.config'])
->name('demo');
'app' => [
'request' => [
'route' => 'jaxon', // The route name
'middlewares' => ['web'],
],
],
'lib' => [
'core' => [
'request' => [
'uri' => '/jaxon', // The route url
],
],
],
// resources/views/demo/index.blade.php
<!-- In page header -->
@jxnCss()
</head>
<body>
<!-- Page content here -->
</body>
<!-- In page footer -->
@jxnJs()
@jxnScript()
<div class="col-md-12" @jxnBind($rqAppTest)>
@jxnHtml($rqAppTest)
</div>
<div class="col-md-12" @jxnPagination($rqAppTest)>
</div>
<select class="form-select"
@jxnOn('change', $rqAppTest->setColor(jq()->val()))>
<option value="black" selected="selected">Black</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
<button type="button" class="btn btn-primary"
@jxnClick($rqAppTest->sayHello(true))>Click me</button>
<div class="row" @jxnEvent([
['.app-color-choice', 'change', $rqAppTest->setColor(jq()->val())]
['.ext-color-choice', 'change', $rqExtTest->setColor(jq()->val())]
])>
<div class="col-md-12">
<select class="form-control app-color-choice">
<option value="black" selected="selected">Black</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
</div>
<div class="col-md-12">
<select class="form-control ext-color-choice">
<option value="black" selected="selected">Black</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
</div>
</div>
json
""jaxon-php/jaxon-laravel": "^5.0"
}
bash
php artisan vendor:publish --tag=config