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
Open the migration file and define the necessary fields:
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSiteSettingsTable extends Migration
{
public function up()
{
Schema::create('site_settings', function (Blueprint $table) {
$table->id();
$table->string('key')->unique();
$table->string('value')->nullable();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('site_settings');
}
} php artisan make:model SiteSetting namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SiteSetting extends Model
{
protected $fillable = ['key', 'value'];
}Generate a new service provider to handle shared data:
namespace App\Http\Controllers;
class FileController extends BaseController
{
public function upload()
{
if (!$this->canUploadFiles()) {
return redirect()->back()->with('error', 'File uploads are disabled.');
}
// Handle file upload logic here
}
}Please sign in to join the discussion.
No comments yet. Be the first to share your thoughts!