skip to Main Content

Jquery – If hasClass then addClass to parent node

I am trying to add new class to the parent class if nodes has a certain class. $(document).ready(function() { if ($(".row").hasClass("lock-icon")) { $(".row .lock-icon").parent(".content-box").addClass('locked-badge'); } }); .locked-badge { opacity: 0.2; cursor: not-allowed; } <div class="col-md-6 mb-5"> <div class="content-box"> <div class="row">…

VIEW QUESTION

How do I automatically insert the auth user id when creating a new model with a foreign key in Laravel?

I have a 'projects' table in my Laravel project. The migration looks something like this: Schema::create('projects', function (Blueprint $table) { $table->id(); $table->string('title'); $table->string('key')->nullable(); $table->integer('bpm')->nullable(); $table->boolean('is_collaborative')->default(false); $table->foreignId('owner_id')->constrained('users')->cascadeOnDelete(); $table->timestamps(); }); I want the owner_id field to reference a user's id in order…

VIEW QUESTION

Laravel – PUT method is not supported for route vehiculos/7676729/edit. Supported methods: GET, HEAD

I'm trying to understand PHP Laravel but can't figure out how to make this put operation. Basically I have my db created with artisan and the table for vehiculos is simple. Schema::create('vehiculos', function (Blueprint $table) { $table->string('id')->foreign('idFk')->references('id')->on('clientes')->onDelete('cascade'); $table->string('marca'); $table->string('modelo'); $table->year('anio');…

VIEW QUESTION
Back To Top
Search