PHP code example of yhshanto / larapress

1. Go to this page and download the library: Download yhshanto/larapress 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/ */

    

yhshanto / larapress example snippets


/*
 * Plugin Name:       Your Plugin name
 * Plugin URI:        your-plugin-url
 * Description:       This is a short description
 * Version:           1.0.0
 * Author:            Plugin Author
 * Author URI:        Author Url
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       Text Domain
*/


namespace Plugin;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    //
}

<h1>
    {{ $heading }}
</h1>
<p>
    {!! $description !!}
</p>

$data['heading'] = 'Larapress';
$data['description'] = 'Write Something Here';

view('welcome', $data);

$data['heading'] = 'Larapress';
$data['description'] = 'Write Something Here';

$view = view('welcome', $data, true);


namespace Plugin\Hooks;

class Auto extends Hook
{
	
	function boot()
	{

		$this->loader->add_filter('the_title', 'title');

	}

	function title($title)

	{

		return 'LaraPress';

	}
}

$hooks = array(
	'Auto'
);

add_action( $hook, $callback, $priority = 10, $accepted_args = 1 )

add_filter( $hook, $callback, $priority = 10, $accepted_args = 1 )