-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
750f89b
commit 20e97c5
Showing
16 changed files
with
355 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
database/migrations/2020_10_24_190145_create_post_user_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class CreatePostUserTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('post_user', function (Blueprint $table) { | ||
$table->id(); | ||
$table->unsignedBigInteger('post_id'); | ||
$table->unsignedBigInteger('user_id'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('post_user'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
@extends('layouts.backend.app') | ||
@push('header') | ||
<link rel="stylesheet" href="{{asset('backend/vendors/datatables.net-bs4/css/dataTables.bootstrap4.min.css')}}" /> | ||
<link rel="stylesheet" href="{{asset('backend/vendors/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css')}}" /> | ||
<link rel="stylesheet" href="http://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css"> | ||
@endpush | ||
@section('content') | ||
<div id="right-panel" class="right-panel"> | ||
<div class="breadcrumbs"> | ||
<div class="col-sm-4"> | ||
<div class="page-header float-left"> | ||
<div class="page-title"> | ||
<h1>Post</h1> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-sm-8"> | ||
<div class="page-header float-right"> | ||
<div class="page-title"> | ||
<ol class="breadcrumb text-right"> | ||
<li><a href="#">Dashboard</a></li> | ||
<li> | ||
<a href="#" class="active">Post Table</a> | ||
</li> | ||
</ol> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="content mt-3"> | ||
<div class="animated fadeIn"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
@if ($errors->any()) | ||
|
||
@foreach ($errors->all() as $error) | ||
<div class="alert alert-danger alert-dismissible fade show" role="alert"> | ||
<span class="badge badge-pill badge-danger">Erorr</span> {{$error}} | ||
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
@endforeach | ||
|
||
@endif | ||
|
||
</div> | ||
<div class="col-md-12"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
<strong class="card-title">{{$post->title}} Liked User Table</strong> | ||
|
||
</div> | ||
<div class="card-body"> | ||
<table id="bootstrap-data-table-export" class="table table-striped table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>#</th> | ||
<th>User Name</th> | ||
<th>User Id</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach ($post->likedUsers as $key => $likeUser) | ||
<tr> | ||
<td>{{$key+1}}</td> | ||
<td>{{$likeUser->name}}</td> | ||
<td>{{$likeUser->id}}</td> | ||
</tr> | ||
@endforeach | ||
|
||
</tbody> | ||
</table> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
<!-- .content --> | ||
@endsection | ||
|
||
@push('footer') | ||
|
||
<script src="{{asset('backend/vendors/datatables.net/js/jquery.dataTables.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/datatables.net-bs4/js/dataTables.bootstrap4.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/datatables.net-buttons/js/dataTables.buttons.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/jszip/dist/jszip.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/pdfmake/build/pdfmake.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/pdfmake/build/vfs_fonts.js')}}"></script> | ||
<script src="{{asset('backend/vendors/datatables.net-buttons/js/buttons.html5.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/datatables.net-buttons/js/buttons.print.min.js')}}"></script> | ||
<script src="{{asset('backend/vendors/datatables.net-buttons/js/buttons.colVis.min.js')}}"></script> | ||
<script src="{{asset('backend/assets/js/init-scripts/data-table/datatables-init.js')}}"> | ||
<script> | ||
$(document).ready(function () { | ||
(function ($) { | ||
$('#filter').keyup(function () { | ||
var rex = new RegExp($(this).val(), 'i'); | ||
$('.searchable tr').hide(); | ||
$('.searchable tr').filter(function () { | ||
return rex.test($(this).text()); | ||
}).show(); | ||
}) | ||
}(jQuery)); | ||
}); | ||
</script> | ||
<script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script> | ||
<script src="http://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script> | ||
{!! Toastr::message() !!} | ||
@endpush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.