PHP code example of lebenlabs / simplecms

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

    

lebenlabs / simplecms example snippets

 bash
    composer dump-autoload
  
 bash
      php artisan vendor:publish
  
 bash
    composer dump-autoload
  
 php
      /* --------------------------*/
      
      abstract class Usuario implements Authenticatable, CanResetPassword, CanEditMenu, CanEditMenuItem, CanManagePublicaciones, CanViewPublicacion
      
      /* --------------------------*/
      

    /**
     * Returns true if the Entity can edit Menu
     *
     * @return boolean
     */
    public function canEditMenu()
    {
        return $this->esAdministrador();
    }

    /**
     * Returns true if the Entity can edit Menu Item
     *
     * @return bool
     */
    public function canEditMenuItem()
    {
        return $this->esAdministrador();
    }

    /**
     * Returns true if the Entity can manage publicaciones
     *
     * @return bool
     */
    public function canManagePublicaciones()
    {
        return $this->esAdministrador();
    }

    /**
     * @param Publicacion $publicacion
     * @return bool
     */
    public function canViewPublicacion(Publicacion $publicacion)
    {
        if ($this->esAdministrador()) {
            return true;
        }

        if ($publicacion->getPublicada()) {
            return true;
        }

        return false;
    }
    
       /* --------------------------*/      
      
  
 php
    {{--Laravel Package - Lebenlabs\SimpleCMS--}}
    @
bash 
    php artisan lebenlabs:simplecms:create-menu 
  
 php
    // ComposerServiceProvider
    public function boot()
    {
        View::composer(
            'Lebenlabs/SimpleCMS::Partials.Menu.show', SimpleCMSViewComposer::class
        );
    }
  
    // SimpleCMSViewComposer
    public function compose(View $view)
    {
        $view->with('rootMenuItems', $this->simpleCMS->findAllRootMenuItems());
    }