Bootstrap modal not working on iOS - shows only grey background - laravel

I made a website with Laravel. For design of web site I use Bootstrap. In on my page I needed modal component. Now I deployed my web site on server link on website and I was testing website with my iPhone. When I tested modal I get only grey background without modal. I also tested on PC and Android mobile phone and work fine. I try on Edge, Safari and Chrome on iPhone but I always get the same result.
Here is my code:
#extends('layouts.frontend')
#section('title', 'TK Pazin | Rang-liste Piramida')
#section('content')
<!-- Page Content -->
<div class="container">
<!-- Page Heading -->
<h1 class="my-4" style="text-align:center; color: #ba3631;">Rang-lista | Piramida {{ $sezona->godina }}</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
#foreach($sezone as $sezona)
#if($sezona->id == session('odabrana_godina'))
<li class="breadcrumb-item active" aria-current="page">{{ $sezona->godina }}</li>
#else
<li class="breadcrumb-item">{{ $sezona->godina }}</li>
#endif
#endforeach
</ol>
</nav>
<div>
<div class="media mb-5">
<div class="mr-3"><a href="../datoteke/Pravila-Pojedinačni-turniri.pdf" target="_blank"><i
class="far fa-file-pdf fa-3x"></i></a></div>
<div class="media-body mt-3">
<a href="/datoteke/Pravila-Piramida.pdf" target="_blank">
<h5 class="mt-0">Pravila
natjecanja u piramidi
</h5>
</a>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Ime i prezime</th>
#foreach($kola as $kolo)
<th scope="col">{{ $kolo->naziv }}</th>
#endforeach
<th scope="col">Ukupno</th>
</tr>
</thead>
<tbody>
#foreach($igraci as $igrac)
#if($igrac->igrac_piramida()->whereIn('turnir_piramida_id', $kola_id)->sum('bodovi') != 0)
<tr>
<td scope="row" class="sno"> </td>
<td>
<button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#view_{{ $igrac->id }}">{{ $igrac->ime . " " . $igrac->prezime }}</button>
<!-- Modal -->
<div class="modal fade" id="view_{{ $igrac->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Natjecatelj: {{ $igrac->ime . " " . $igrac->prezime }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-6">
<img src="{{ $igrac->slika }}" alt="..." class="img-thumbnail">
</div>
<div class="col-6">
<b>Prebivalište: </b>
<p> {{ $igrac->prebivaliste }}</p>
<b>Igra: </b>
<p> {{ $igrac->igra }}</p>
<b>Član kluba od:</b>
<p> {{ $igrac->clanstvo }}. godine</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Zatvori</button>
</div>
</div>
</div>
</div>
</td>
#foreach($kola as $kolo)
#foreach($igrac->igrac_piramida as $ip)
#if($ip->pivot->turnir_piramida_id == $kolo->id)
<td>{{ $ip->pivot->bodovi }}</td>
#endif
#endforeach
#endforeach
<td>{{ $igrac->igrac_piramida()->whereIn('turnir_piramida_id', $kola_id)->sum('bodovi') }}</td>
</tr>
#endif
#endforeach
</tbody>
</table>
</div>
</div>
<!-- /.container -->
#endsection
#section('script')
<script>
$(document).ready(function(){
//use a special class name or id for the table
//using find I'm getting all tr elements in the table
//using not(':eq(0)') I'm ignoring the first tr element
//using each I'm iterating through the selected elements
$('table').find('tr').not(':eq(0)').each(function(i){
//using children('td:eq(0)') I'm getting the first td element inside the tr
$(this).children('td:eq(0)').addClass('sno').text(i+1);
});
});
</script>
#endsection

Related

How to update ids in pivot table in laravel9

in laravel 9 i have tables
team (columns are team_name, igl_name, match_id)
tournament
match_id
and tour_team is table (colums are team_id, tournamnet_id and match_id)
in the option I am retrieving match id in value now I want to update this match id with match_id in tour_team, table which is pivot table for that for specific team. and tournament
here is form
<form action="" method="POST">
<div class="form-group">
<div class="form-control-wrap">
<select name="match_id" class="js-select" id="tax-class" data-sort="false">
<option value="">Select an option</option>
#foreach ($matches as $mate)
<option value="{{$mate->id}}">{{$mate->name}}</option>
#endforeach
</select>
</div>
</div>
<button type="submit">Update Match</button>
</form>
Here is complete code of team
#foreach ($team as $item)
#if ($item->pivot->match_id == 0)
<tr style="background-color: #dddddd;">
<td class="tb-col">
<div class="media-group">
<div class="media media-md flex-shrink-0 media-middle media-circle">
<img src="images/product/a.jpg" alt="">
</div>
<div class="media-text">
{{ $item->team_name }}
</div>
</div>
</td>
<td class="tb-col">
<div class="media-group">
<div class="media media-md flex-shrink-0 media-middle media-circle">
<img src="images/product/a.jpg" alt="">
</div>
<div class="media-text">
{{ $item->igl_name }}
<span class="text smaller">{{ $item->igl_id }}</span>
</div>
</div>
</td>
<td class="tb-col tb">
<form action="" method="POST">
<div class="form-group">
<div class="form-control-wrap">
<select name="match_id" class="js-select" id="tax-class" data-sort="false">
<option value="">Select an option</option>
#foreach ($matches as $mate)
<option value="{{$mate->id}}">{{$mate->name}}</option>
#endforeach
</select>
</div>
</div>
<button type="submit">Update Match</button>
</form>
</td>
<td>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#example-{{ $item->id }}">
<em class="icon fa fa-users"></em>
</button>
<!-- Modal -->
<div class="modal fade" id="example-{{ $item->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalScrollableTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalScrollableTitle">{{ $item->team_name }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
#foreach ($item->members as $members)
<div class="media-group">
<div class="media media-md flex-shrink-0 media-middle media-circle">
<img src="images/product/a.jpg" alt="">
</div>
<div class="media-text">
{{ $members->player_name }}
<span class="text smaller">{{ $members->player_id }}</span>
</div>
</div>
#endforeach
</div>
</td>
<td>
<button type="button" class="btn btn-color-primary btn-hover-primary btn-icon"><i class="fa-solid fa-ban"></i></button>
</td>
</tr>
#endif
#endforeach
want to update id in pivot table in laravel9

My LiveWIre wire Click Action is not working

This is my Livewire Component. When I try to click a function like delete it doesn't work and doesn't give me dd(). Everything is ok I've checked several times and tried everything.
#extends('admin.layouts.layout')
#section('content')
<!-- Modal -->
<div>
<div
class="modal fade"
id="deleteModal"
tabindex="-1"
aria-labelledby="exampleModalLabel"
aria-hidden="true"
>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Catagory Delete</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<form wire:submit.prevent="destroyCatagory">
<div class="modal-body">
<h6>Are You Sure YOu Want To Delete this Data?</h6>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-bs-dismiss="modal"
>
Close
</button>
<button type="submit" class="btn btn-primary">Yes Delete</button>
</div>
</form>
</div>
</div>
</div>
<div class="row">
#if (session()->has('message'))
<div class="alert alert-success">{{session('message')}}</div>
#endif
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h4>
Catagory
<a
href="{{url('admin/catagory/create')}}"
class="float-end btn btn-primary"
>Add Catagory</a
>
</h4>
</div>
<div class="card-body">
<table class="table table-striped table-hover">
<tr>
<th>ID</th>
<th>Name</th>
<th>Status</th>
<th>Action</th>
</tr>
#forelse ($catagories as $catagory)
<tr>
<td>{{$catagory->id}}</td>
<td>{{$catagory->name}}</td>
<td>{{$catagory->status=='1'? 'Hidden':'visible'}}</td>
<td>
<a
href="{{url('admin/catagory/'.$catagory->id.'/edit')}}"
class="btn btn-success"
>
Edit</a
>
<a
wire:click="deleteCatagory({{$catagory->id}})"
class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#deleteModal"
>Delete</a
>
</td>
</tr>
#empty #endforelse ($catagories as $catagory)
</table>
{{$catagories->links()}}
</div>
<div class="card-footer"></div>
</div>
</div>
</div>
</div>
#endsection
This is my index.blade.php for the livewire component. Everything seems to be ok in this component. I've checked everything several times and I've been stuck on this for many days, please help me.
public function deleteCatagory($id)
{
dd($id);
$this->catagory_id = $id;
}
public function destroycatagory()
{
$catagory= Catagory::find($this->catagory_id);
$path = 'uploads/catagory/'.$catagory->image;
if(File::exists($path)) {
File::delete($path);
}
$catagory->delete();
session()->flash('message','Catagory Deletd Successfully');
}

live.ERROR: Trying to get property 'title' of non-object (View: C:\xampp\htdocs\core\resources\views\user\signal-all.blade.php)

ERROR: Trying to get property 'title' of non-object (View: C:\xampp\htdocs\core\resources\views\user\signal-all.blade.php)
Dear, help me please, I can't find the error, it was working fine.
signal-all.blade.php
#extends('layouts.user')
#section('content')
<div class="page-body">
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5>Historial - Ideas de Trading</h5>
<div class="card-header-right">
<ul class="list-unstyled card-option">
<li><i class="fa fa-chevron-left"></i></li>
<li><i class="fa fa-window-maximize full-card"></i></li>
<li><i class="fa fa-minus minimize-card"></i></li>
<li><i class="fa fa-times close-card"></i></li>
</ul>
</div>
</div>
<div class="card-block">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" id="sample_1">
<thead>
<tr>
<th>#</th>
<th>Fecha</th>
<th>Titulo</th>
<th>Mercado - Par - Tipo</th>
<th>TF - Estado</th>
<th>Acción</th>
</tr>
</thead>
<tbody>
#php $p = 0 #endphp
#if (\Illuminate\Support\Facades\Auth::user()->expire_time != 1 and \Carbon\Carbon::parse(\Illuminate\Support\Facades\Auth::user()->expire_time)->isPast())
<tr>
<td colspan="7"><h6 class="text-center">Su plan esta expirado, actualice su plan Actualizar Plan</h6></td>
</tr>
#elseif (\Illuminate\Support\Facades\Auth::user()->plan_status == 0)
<tr>
<td colspan="7"><h6 class="text-center">Tablero de señales desactivado. PAGO PENDIENTE</h6></td>
</tr>
#else
#php $p = 0 #endphp
#foreach($signal as $k => $p)
<tr>
<td>{{ $k + $signal->firstItem() }}</td>
<td>{{\Carbon\Carbon::parse($p->created_at)->format('d/m/Y - h:i:s A')}}</td>
<td>{{ $p->signal->title }}</td>
<td>{{ $p->signal->asset->name }} - {{ $p->signal->symbol->name }} - {{ $p->signal->type->name }}</td>
<td>{{ $p->signal->frame->name }} - {{ $p->signal->status->name }}</td>
<td>
<i class="fa fa-eye"></i> Ver
</td>
</tr>
#endforeach
#endif
</tbody>
</table>
</div>
#if ($p)
{{$signal->links('basic.pagination')}}
#endif
</div>
</div>
</div>
</div>
</div>
#endsection
I also add layouts.user.php
#php
$planId = Auth::user()->plan_id;
$allSignal = App\SignalPlan::wherePlan_id($planId)->count();
#endphp
<div class="pcoded-main-container">
<div class="pcoded-wrapper">
<nav class="pcoded-navbar">
<div class="sidebar_toggle"><i class="icon-close icons"></i></div>
<div class="pcoded-inner-navbar main-menu">
<div class="pcoded-navigation-label">Panel de Control</div>
<ul class="pcoded-item pcoded-left-item">
<li class="{{ Request::is('user-dashboard') ? 'active' : '' }}">
<a href="{{ route('user-dashboard') }}">
<span class="pcoded-micon"><i class="ti-home"></i><b>D</b></span>
<span class="pcoded-mtext">Inicio</span>
<span class="pcoded-mcaret"></span>
</a>
</li>
</ul>
<div class="pcoded-navigation-label">Ideas de Comercio</div>
<ul class="pcoded-item pcoded-left-item">
<li class="{{ Request::is('user/all-signal') ? 'active' : '' }}">
<a href="{{ route('user-all-signal') }}">
<span class="pcoded-micon"><i class="ti-stats-up"></i><b>D</b></span>
<span class="pcoded-mtext">Señales</span>
<span class="pcoded-badge label label-primary ">{{ $allSignal }}</span>
<span class="pcoded-mcaret"></span>
</a>
</li>
</ul>
<div class="pcoded-navigation-label">Administrar Ganancias</div>
<ul class="pcoded-item pcoded-left-item">
<li class="">
<a href="{!! route('logout') !!}" onclick="event.preventDefault();document.getElementById('logout-form').submit();">
<span class="pcoded-micon"><i class="ti-share-alt"></i><b>D</b></span>
<span class="pcoded-mtext">Salir</span>
<span class="pcoded-mcaret"></span>
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
</li>
</ul>
</div>
</nav>
<div class="pcoded-content">
<div class="pcoded-inner-content">
<div class="main-body">
<div class="page-wrapper">
#if($errors->any())
#foreach ($errors->all() as $error)
<div class="alert alert-warning icons-alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<i class="icofont icofont-close-line-circled"></i>
</button>
<p>{!! $error !!}</p>
</div>
#endforeach
#endif
#yield('content')
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
#if(Auth::user()->plan_status == 1 and Auth::user()->plan->telegram_status == 1)
{!! $basic->chat !!}
#endif
<script>
#if(Session::has('message'))
var type = "{{ Session::get('type', 'info') }}";
switch(type){
case 'info':
toastr.info("{{ Session::get('message') }}");
break;
case 'warning':
toastr.warning("{{ Session::get('message') }}");
break;
case 'success':
toastr.success("{{ Session::get('message') }}");
break;
case 'error':
toastr.error("{{ Session::get('message') }}");
break;
}
#endif
</script>
#yield('scripts')
Controller
public function AllSignal()
{
$data['page_title'] = 'All Signal';
$data['signal'] = SignalPlan::wherePlan_id(Auth::user()->plan_id)->orderBy('id','desc')->paginate(10);
return view('user.signal-all',$data);
}
when I try to execute it throws ERROR: Trying to get property 'title' of non-object
and use plan_status == 1 It works perfect
The syntax of foreach($signal as $k => $p) means, for each element in the array of $signal as a key value pair, which means $p already represents a single $signal object from the array, and $k is the array index. Within a single object of $singal, you have the property title. In order to refer to that attribute, you just need to do $p->title. If you are unsure, you could perform a dd($signal) or a dd($p) somewhere on your blade to verify what it contains

Laravel - How to Customize Ellipsis with a button

I have a web application project using Laravel-5.8. In the project, I applied HTML text editor.
Controller
public function create()
{
return view('organization.announcements.create');
}
public function store(StoreAnnouncementRequest $request)
{
try {
$announcement = new OrgAnnouncement();
$announcement->title = $request->title;
$announcement->description = $request->description;
$announcement->save();
Session::flash('success', 'Announcement is created successfully');
return redirect()->route('organization.announcements.index');
} catch (Exception $exception) {
Session::flash('danger', 'Announcement creation failed!');
return redirect()->route('organization.announcements.index');
}
}
View
<table class=" table table-bordered table-striped table-hover datatable">
<thead>
<tr>
<th width="10">
#
</th>
<th>
Announcement Title
</th>
<th>
Description
</th>
<th>
</th>
</tr>
</thead>
<tbody>
#foreach($announcements as $key => $announcement)
<td>
{{$key+1}}
</td>
<td>
{{$announcement->title ?? '' }}
</td>
<td>
{{str_limit($announcement->description, $limit = 20, $end = ' ...')}}
</td>
<td>
#can('announcement_show')
<a class="btn btn-xs btn-primary" href="{{ route('organization.announcements.show', $announcement->id) }}">
{{ trans('global.view') }}
</a>
#endcan
#can('announcement_edit')
<a class="btn btn-xs btn-info" href="{{ route('organization.announcements.edit', ['id'=>$announcement->id]) }}">
{{ trans('global.edit') }}
</a>
#endcan
#can('announcement_delete')
<a class="btn btn-xs btn-danger" data-toggle="modal" data-target="#confirm-delete{{ $announcement->id }}" data-original-title="Close">
<span style="color:white;">{{ trans('global.delete') }}</span>
</a>
#endcan
<div class="modal fade" id="confirm-delete{{ $announcement->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Delete Announcement</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="{{route('organization.announcements.destroy',$announcement->id)}}" method="post">
{{ csrf_field() }}
<p>Are you sure you want to delete this Announcement?</p>
<div class="modal-header">
<h4>{{ $announcement->title }}</h4>
</div>
</form>
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-danger">Delete</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</td>
</tr>
#endforeach
</tbody>
</table>
The field description is the text editor. On the view blade, I truncated the field description to 20 characters and ... will be displayed as shown in my field.
However, what I want to achieve is that I want to replace the ... with a button that will have view more. Then it is clicked, it will show the full content in a modal form of redirect to another page.
How do I achieve this?
Thank you
You may use
<td>
{{str_limit($announcement->description, $limit = 20, $end = ' ...')}}
#if(strlen($announcement->description) > 20)
Show more
#endif
</td>

DataTables Custom Search in Laravel

I'm using laravel to create a contact page, and this is my view code:
<table id="example">
<thead>
<tr>
<th class="no-sort"></th>
</tr>
</thead>
<tbody>
<?php $idx = 1; ?>
#foreach($users as $result)
#if($idx == 1) <tr> #endif
<td class="col-md-4 col-sm-4 col-xs-12 animated fadeInDown">
<div class="well profile_view">
<div class="col-sm-12">
<h4 class="brief"><i>Digital Strategist</i></h4>
<div class="left col-xs-7">
<h2>{!! $result->first_name !!}</h2>
<p><strong>Username: </strong> {!! $idx !!} </p>
<ul class="list-unstyled">
<li>{!! $result->email !!}</li>
</ul>
</div>
<div class="right col-xs-5 text-center">
#if($result->image)
{!! Html::image('packages/calibre/images/profile/'.$result->image, '', array("class"=>"img-circle img-responsive")) !!}
#else
{!! Html::image('packages/calibre/images/profile/none.png', '', array("class"=>"img-circle img-responsive")) !!}
#endif
</div>
</div>
<div class="col-xs-12 bottom text-center">
<div class="col-xs-12 col-sm-12 emphasis">
<button type="button" class="btn btn-success btn-xs pull-left"><i class="fa fa-check"></i> Active</button>
<button type="button" class="btn btn-primary btn-xs pull-right"><i class="fa fa-search"></i> View Profile </button>
</div>
</div>
</div>
</td>
#if($idx == 3) </tr> #endif
<?php if($idx == 3) $idx = 1; else $idx++; ?>
#endforeach
</tbody>
</table>
the layout is not like common tables, it's using tag from it's template.
How to enable it using DataTables to search and paging? anyone could help me?

Resources