Skip to content

Code sa review - #1

Open
Weolcan wants to merge 1 commit into
gingdvt4ch:mainfrom
Weolcan:patch-2
Open

Code sa review#1
Weolcan wants to merge 1 commit into
gingdvt4ch:mainfrom
Weolcan:patch-2

Conversation

@Weolcan

@Weolcan Weolcan commented Dec 17, 2024

Copy link
Copy Markdown

blades

`

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <style> .rate { float: left; height: 46px; padding: 0 10px; } .rate:not(:checked) > input { position:absolute; display: none; } .rate:not(:checked) > label { float:right; width:1em; overflow:hidden; white-space:nowrap; cursor:pointer; font-size:30px; color:#ccc; } .rated:not(:checked) > label { float:right; width:1em; overflow:hidden; white-space:nowrap; cursor:pointer; font-size:30px; color:#ccc; } .rate:not(:checked) > label:before { content: '★ '; } .rate > input:checked ~ label { color: #ffc700; } .rate:not(:checked) > label:hover, .rate:not(:checked) > label:hover ~ label { color: #deb217; } .rate > input:checked + label:hover, .rate > input:checked + label:hover ~ label, .rate > input:checked ~ label:hover, .rate > input:checked ~ label:hover ~ label, .rate > label:hover ~ input:checked ~ label { color: #c59b08; } .star-rating-complete{ color: #c59b08; } .rating-container .form-control:hover, .rating-container .form-control:focus{ background: #fff; border: 1px solid #ced4da; } .rating-container textarea:focus, .rating-container input:focus { color: #000; } .rated { float: left; height: 46px; padding: 0 10px; } .rated:not(:checked) > input { position:absolute; display: none; } .rated:not(:checked) > label { float:right; width:1em; overflow:hidden; white-space:nowrap; cursor:pointer; font-size:30px; color:#ffc700; } .rated:not(:checked) > label:before { content: '★ '; } .rated > input:checked ~ label { color: #ffc700; } .rated:not(:checked) > label:hover, .rated:not(:checked) > label:hover ~ label { color: #deb217; } .rated > input:checked + label:hover, .rated > input:checked + label:hover ~ label, .rated > input:checked ~ label:hover, .rated > input:checked ~ label:hover ~ label, .rated > label:hover ~ input:checked ~ label { color: #c59b08; } </style>

@if(!empty($value->star_rating))

Review

@for($i=1; $i<=$value->star_rating; $i++)
{{-- --}}
{{$i}} stars
@endfor

{{ $value->comments }}

@else

https://github.com/csrf
Review

5 stars

4 stars

3 stars

2 stars

1 star

<textarea class="form-control" name="comment" rows="6 " placeholder="Comment" maxlength="200"></textarea>

Submit

@endif`

@Weolcan Weolcan closed this Dec 17, 2024
@Weolcan
Weolcan deleted the patch-2 branch December 17, 2024 20:26
@Weolcan
Weolcan restored the patch-2 branch December 17, 2024 20:26
@Weolcan Weolcan changed the title blades Code sa review Dec 17, 2024
@Weolcan

Weolcan commented Dec 17, 2024

Copy link
Copy Markdown
Author

routes

Route::post('review-store', 'BookingController@reviewstore')->name('review.store');

@Weolcan Weolcan reopened this Dec 17, 2024
@Weolcan

Weolcan commented Dec 17, 2024

Copy link
Copy Markdown
Author

migration

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateReviewRatingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
/
public function up()
{
Schema::create('review_ratings', function (Blueprint $table) {
$table->increments('id');
$table->unsignedBigInteger('booking_id');
$table->longText('comments')->nullable();
$table->integer('star_rating');
$table->enum('status', ['active', 'deactive']);
$table->timestamps();
});
}
/
*
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('review_ratings');
}
}``

@Weolcan

Weolcan commented Dec 17, 2024

Copy link
Copy Markdown
Author

controllers

public function reviewstore(Request $request){
$review = new ReviewRating();
$review->booking_id = $request->booking_id;
$review->comments= $request->comment;
$review->star_rating = $request->rating;
$review->user_id = Auth::user()->id;
$review->service_id = $request->service_id;
$review->save();
return redirect()->back()->with('flash_msg_success','Your review has been submitted Successfully,');
}

@Weolcan Weolcan closed this Dec 17, 2024
@Weolcan Weolcan reopened this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant