1. Go to this page and download the library: Download achyutn/laravel-helpers 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/ */
achyutn / laravel-helpers example snippets
namespace App\Models;
use AchyutN\LaravelHelpers\Traits\HasTheSlug;
class Post extends Model
{
use HasTheSlug;
protected string $sluggableColumn = 'title';
}
namespace App\Models;
use AchyutN\LaravelHelpers\Traits\HasTheMedia;
use Spatie\MediaLibrary\HasMedia;
class Post extends Model implements HasMedia
{
use HasTheMedia;
}
namespace App\Models;
use AchyutN\LaravelHelpers\Models\MediaModel;
class Post extends MediaModel
{
//
}
namespace App\Models;
use AchyutN\LaravelHelpers\Models\MediaModel;
class Post extends MediaModel
{
protected array $theMediaCollections = ['cover', 'gallery', 'profile'];
}