1. Go to this page and download the library: Download softrules/laravel 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/ */
use SoftRules\PHP\UI\Components\Button;
use SoftRules\PHP\UI\Style\ButtonComponentStyle;
use SoftRules\PHP\UI\Style\StyleData;
Button::setStyle(new ButtonComponentStyle(
default: new StyleData(class: 'btn btn-default'),
primary: new StyleData(class: 'btn btn-primary'),
success: new StyleData(class: 'btn btn-success'),
danger: new StyleData(class: 'btn btn-danger'),
));
declare(strict_types=1);
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use SoftRules\PHP\UI\Components\Button;
use SoftRules\PHP\UI\Style\ButtonComponentStyle;
use SoftRules\PHP\UI\Style\StyleData;
final class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Button::setStyle(new ButtonComponentStyle(
default: new StyleData(class: 'btn btn-default'),
primary: new StyleData(class: 'btn btn-primary'),
success: new StyleData(class: 'btn btn-success'),
danger: new StyleData(class: 'btn btn-danger'),
));
}
}
use SoftRules\PHP\UI\Components\Button;
use SoftRules\PHP\UI\Style\ButtonComponentStyle;
use SoftRules\PHP\UI\Style\StyleData;
Button::setStyle(new ButtonComponentStyle(
default: new StyleData(inlineStyle: 'background-color: #f00; color: #fff;'),
primary: new StyleData(inlineStyle: 'background-color: blue; color: #fff;'),
success: new StyleData(inlineStyle: 'background-color: green; color: #fff;'),
danger: new StyleData(inlineStyle: 'background-color: red; color: #fff;'),
));
use SoftRules\PHP\UI\Components\Button;
use SoftRules\PHP\UI\Style\ButtonComponentStyle;
use SoftRules\PHP\UI\Style\StyleData;
Button::setStyle(new ButtonComponentStyle(
default: new StyleData(class: 'bg-gray-300 text-gray-800'),
primary: new StyleData(class: 'bg-blue-500 text-white'),
success: new StyleData(class: 'bg-green-500 text-white'),
danger: new StyleData(class: 'bg-red-500 text-white'),
));