1. Go to this page and download the library: Download headlesslaravel/cards 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/ */
headlesslaravel / cards example snippets
Route::cards('api/dashboard', Dashboard::class);
namespace App\Http\Cards;
use HeadlessLaravel\Cards\Cards;
class Dashboard extends Cards
{
public function cards(): array
{
return [
Card::make('Total Users')
->link('/users')
->component('number-card')
->value(function() {
return User::count();
}),
];
}
}