Premium Component
This is a premium Content. Upgrade to access the content and more premium features.
Upgrade to PremiumDeveloperBreeze
It looks like you're using an adblocker. Our website relies on ads to keep running. Please consider disabling your adblocker to support us and access the content.
This is a premium Content. Upgrade to access the content and more premium features.
Upgrade to PremiumMore content you might like
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SiteSetting extends Model
{
protected $fillable = ['key', 'value'];
}Add initial content-related settings for testing.
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class SiteSettingsSeeder extends Seeder
{
public function run()
{
DB::table('site_settings')->insert([
['key' => 'app_name', 'value' => 'My Laravel App'],
['key' => 'app_timezone', 'value' => 'UTC'],
['key' => 'app_language', 'value' => 'en'],
]);
}
} php artisan db:seed --class=SiteSettingsSeederBy centralizing data loading in Laravel using service providers and caching, you’ve optimized your application for better performance and maintainability. This approach is ideal for managing global configurations, feature toggles, and frequently accessed data efficiently.
We will implement these as shared properties and methods in a Base Controller.
If you don’t already have a BaseController, create one manually or via command:
Please sign in to join the discussion.
No comments yet. Be the first to share your thoughts!