PHP code example of mawuekom / laravel-custom-view-components

1. Go to this page and download the library: Download mawuekom/laravel-custom-view-components 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/ */

    

mawuekom / laravel-custom-view-components example snippets


'providers' => [

    ...

    Mawuekom\Customponents\CustomponentsServiceProvider::class,

],



return [

    /**
     * App Name should be set here
     */

    'app_name' => env('APP_NAME', 'My Laravel Project'),

    /*
    |--------------------------------------------------------------------------
    | Bunch of features to enable or disable.
    |--------------------------------------------------------------------------
    */

    'enable' => [
        'app_style_sheet'   => true,
        'app_script'        => true,
    ],
];

<x-customponents::partials.headers title="Page Title" description="Page Description" section="" />

<div>
    <h1>My Laravel Website</h1>
    <hr>
    <p>
        Some content here
    </p>
</div>

<x-customponents::partials.footers />

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <x-customponents::partials.seo-tags title="{{ $title }}" description="{{ $description }}" section="{{ $section }}" />
        @yield('styles')
    </head>
    <body @yield('body_attributes')>

<x-customponents-section name="styles">
    your content goes here
</x-customponents-section>

<x-customponents::partials.headers title="Page Title" description="Page Description" section="" />
    <x-customponents-section name="styles">
        <link rel="stylesheet" href="css/app.css">
    </x-customponents-section>
</x-customponents::partials.headers>

<div>
    <h1>My Laravel Website</h1>
    <hr>
    <p> Some content here </p>
</div>

<x-customponents::partials.footers>
    <x-customponents-section name="scripts">
        <script src="js/app.js"></script>
    </x-customponents-section>
</x-customponents::partials.footers>

<x-customponents::resources.assets type="css" path="css/app.css" />

<x-customponents::partials.headers title="Page Title" description="Page Description" section="" />
    <x-customponents-section name="styles">
        <x-customponents::resources.assets type="css" path="css/app.css" />
    </x-customponents-section>
</x-customponents::partials.headers>

<div>
    <h1>My Laravel Website</h1>
    <hr>
    <p> Some content here </p>
</div>

<x-customponents::partials.footers>
    <x-customponents-section name="scripts">
        <x-customponents::resources.assets type="js" path="js/app.js" />
    </x-customponents-section>
</x-customponents::partials.footers>

<x-customponents::layouts.master title="Page Title" description="Page Description" section="">

    <x-customponents-section name="lyt_master_styles">
        // Your style sheet goes here.
    </x-customponents-section>

    <div>
        <h1>My Laravel Website</h1>
        <hr>
        <p> Some content here </p>
    </div>

    <x-customponents-section name="lyt_master_scripts">
        // Your script files goes here.
    </x-customponents-section>

</x-customponents::layouts.master>
bash
php artisan vendor:publish --provider="Mawuekom\Customponents\CustomponentsServiceProvider"
bash
php artisan vendor:publish --provider="Mawuekom\Customponents\CustomponentsServiceProvider" --tag="config"