1. Go to this page and download the library: Download hasanhawary/lookup-manager 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/ */
namespace Vendor\Product\Models;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
// Single field
public static $helpModelName = 'sku';
// Or multiple fields (concatenated)
// public static $helpModelName = ['brand', 'model_number'];
}
namespace Vendor\Product\Enum;
use HasanHawary\LookupManager\Trait\EnumMethods;
enum StatusEnum: int
{
use EnumMethods;
case ACTIVE = 1;
case INACTIVE = 0;
public static function icons(): array {
return [self::ACTIVE->value => 'check-circle'];
}
}