PHP code example of kabbouchi / laravel-settings

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

    

kabbouchi / laravel-settings example snippets


@extends('layouts.app')

@section('content')
<div class="container">
    <settings-manager></settings-manager>
</div>
@endsection

bash
php artisan vendor:publish --tag=laravel-settings-components
php artisan vendor:publish --tag=laravel-settings-migrations
 php
Settings::auth(function () {
    return auth()->check();
});

Settings::languages(function () {
    return ['en' => 'English', 'ar' => 'Arabic'];
});

Settings::fields(function (Request $request) {
    return [
        Group::make('General', function () {
            return [
                Text::make('Site Name')
                    ->setTranslatable(true)
                    ->help('lorem ipsum....'),
                TextArea::make('Site Description')->setTranslatable(true),
            ];
        }),
        Group::make('Contact Us', function () {
            return [
                Text::make('Phone Number', 'phone')
            ];
        })->setKey('contact-us')
    ];
});