Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<div class="row">
<div class="col-md-12">
<!-- Domain Search form starts -->
<form class="form-horizontal" method="GET" action="{{ route('projects.create') }}" id="projectForm">
<div class="form-group{{ $errors->has('domain_name') ? ' has-error' : '' }}">
<label for="domain_name" class="col-md-4 control-label">Project Name</label>
<div class="col-md-6">
<input id="domain_name" type="text" class="form-control" name="domain_name" value="{{ $domainName = $domain ?? '' }}" required autofocus>
@if ($errors->has('domain_name'))
<span class="help-block">
<strong>{{ $errors->first('domain_name') }}</strong>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">Search</button>
<!-- Domain Search form ends -->
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><h3>Linked Domains</h3></div>
<div class="panel-body">
@if(count($domains) > 0)
<table id="domain_table" class="table table-bordered table-striped">
<th><input type="checkbox" id="checkAllDomains" checked></th>
<th>Domain From</th>
<th>Domain To</th>
<th>Total Links</th>
<th>Unique Pages</th>
<th>Domain to rating</th>
<th>Domain to ahrefs top</th>
@forelse($domains as $key => $domain)
<td><input type="checkbox" checked></td>
<td>{{ $key + 1 }}</td>
<td>{{ $domain->domain_from }}</td>
<td>{{ $domain->domain_to }}</td>
<td>{{ $domain->links }}</td>
<td>{{ $domain->unique_pages }}</td>
<td>{{ $domain->domain_to_rating }}</td>
<td>{{ $domain->domain_to_ahrefs_top }}</td>
<td colspan="7" style="text-align: center;font-size: 20px;padding-top: 30px;"> No Domains Found.</td>
<p class="__msg">No Linked domains found for <code>{{ $domainName }}</code></p>
<p class="__msg">All Linked domains will be displayed here.</p>
@if(count($domains) > 0)
<button type="button" id="addToMasterList" class="btn btn-primary pull-right">Add to master list</button>
rules : {
domain_name : {
required : true
messages : {
domain_name : {
required : 'Please enter a domain name.'
var table= $("#domain_table");
$('td input:checkbox', table).prop('checked', this.checked);
var el = $(this);
el.text('Please wait..');
var domains = $('#domain_table tr:has(td)').map(function(i, v) {
var $td = $('td', this);
isChecked = $(v).first().find('input[type="checkbox"]').is(':checked');
if(isChecked === true)
return {
domain_from: $.trim($td.eq(2).text()),
domain_to: $.trim($td.eq(3).text()),
links: $.trim($td.eq(4).text()),
unique_pages: $.trim($td.eq(5).text()),
domain_to_rating: $.trim($td.eq(6).text()),
domain_to_ahrefs_top: $.trim($td.eq(7).text())
//Add Domains
url : '{{ route('') }}',
method : 'POST',
data : {
project_name : '{{ $domainName }}',
domains : JSON.stringify(domains)
success : function(res, status){
if(res.success === true) {
var site_url = $('meta[name="site_url"]').attr('content');
return window.location = site_url + '/admin/projects/' +;
} else if (res.success === false) {
title: "",
text: res.val_error,
type: "error"
el.text('Add to master list');
error : function(err, s){
console.log('An error occurred.');
console.log(err, s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.