1. Go to this page and download the library: Download rtablada/inspector-gadget 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/ */
rtablada / inspector-gadget example snippets
class ExampleGadget
{
public function render()
{
return 'this string will be returned';
}
}
$gadgetFactory->make('ExampleGadget'); // returns 'this string will be returned'
// app/Gadgets/ArgumentGadget.php
class ArgumentGadget
{
public function render($str)
{
return $str . ' from gadget';
}
}
// view.php
$gadgetFactory->make('ArgumentGadget', 'test'); // returns 'test from gadget'
Gadget::make('ExampleGadget');
@gadget('ExampleGadget')
<div class="sidebar">
<div class="user-history">
<h4>History</h4>
foreach ($userHistory->posts as $historyPost)
// Controller
public function show($id)
{
$post = $this->post->find($id);
$user = $this->auth->user();
return view('post.show', compact('post', 'user'));
}