This question already has answers here:
Bootstrap Element 100% Width
(14 answers)
Closed 1 year ago.
how to make my program can follow resolution my screen, or any idea to make my program make better.
I guess my bootstrap is problem because program display is not fit screen, I hope it can fit on my screen.
and here is my index.blade.php
<!DOCTYPE html>
<html>
<head>
<title>Import Excel Ke Database Dengan Laravel</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<center>
<h2>Import Excel Ke Database Dengan Laravel</h2>
<h3><a target="_blank" href="https://www.malasngoding.com/">www.malasngoding.com</a></h3>
</center>
{{-- notifikasi form validasi --}}
#if ($errors->has('file'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('file') }}</strong>
</span>
#endif
{{-- notifikasi sukses --}}
#if ($sukses = Session::get('sukses'))
<div class="alert alert-success alert-block">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>{{ $sukses }}</strong>
</div>
#endif
<button type="button" class="btn btn-primary mr-5" data-toggle="modal" data-target="#importExcel">
IMPORT EXCEL
</button>
<!-- Import Excel -->
<div class="modal fade" id="importExcel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<form method="post" action="/transaksi/import_excel" enctype="multipart/form-data">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="exampleModalLabel">Import Excel</h3>
</div>
<div class="modal-body">
{{ csrf_field() }}
<label>Pilih file excel</label>
<div class="form-group">
<input type="file" name="file" required="required">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Import</button>
</div>
</div>
</form>
</div>
</div>
I'm using laravel 8.6 and php.
There is my table code, I was tried add container-fluid but still didn't work
<table class='table table-bordered'>
<thead>
<tr>
<th>No</th>
<th>id_subdist</th>
<th>id_toko</th>
<th>id_dso</th>
<th>id_rso</th>
<th>id_channel</th>
<th>id_outlet</th>
<th>id_produk</th>
<th>qty_pcs</th>
<th>harga</th>
<th>nama_promo</th>
<th>free_goods</th>
<th>total_qty_include_free_goods</th>
<th>disc_total</th>
<th>jumlah</th>
<th>tgl_posting</th>
<th>tgl_faktur</th>
<th>created_date</th>
<th>modified_by</th>
<th>modified_date</th>
<th>status</th>
</tr>
</thead>
<tbody>
#php $i=1 #endphp
#foreach($transaksi as $s)
<tr>
<td>{{ $i++ }}</td>
<td>{{$s->id_subdist}}</td>
<td>{{$s->id_toko}}</td>
<td>{{$s->id_dso}}</td>
<td>{{$s->id_rso}}</td>
<td>{{$s->id_channel}}</td>
<td>{{$s->id_outlet}}</td>
<td>{{$s->id_produk}}</td>
<td>{{$s->qty_pcs}}</td>
<td>{{$s->harga}}</td>
<td>{{$s->nama_promo}}</td>
<td>{{$s->free_goods}}</td>
<td>{{$s->total_qty_include_free_goods}}</td>
<td>{{$s->disc_total}}</td>
<td>{{$s->jumlah}}</td>
<td>{{$s->tgl_posting}}</td>
<td>{{$s->tgl_faktur}}</td>
<td>{{$s->created_date}}</td>
<td>{{$s->modified_by}}</td>
<td>{{$s->modified_date}}</td>
<td>{{$s->status}}</td>
</tr>
#endforeach
</tbody>
</table>
Use container-fluid class instead of container class if you want full-screen layout.
Your Code:
<div class="container">
...
</div>
Change it to:
<div class="container-fluid">
...
</div>
The container class is a fixed width container, meaning its max-width changes at each breakpoint. And .container-fluid is a full width container, spanning full screen of the viewport. Read more at Bootstrap Docs
Related
I have this template
<template>
<div class="main">
<div class="container-fluid" style="padding-top: 2.5%">
<h4 class="page-title"><i class="lnr lnr-funnel"> </i> Infusionsoft Accounts
<button #click="addInfusionsoft" class="btn btn-xs btn-success" ><i class="lnr lnr-plus-circle"> </i> New </button>
</h4>
<div class="row">
<div class="col-md-12">
<table class="table table-responsive table-bordered table-striped">
<tr>
<th>ID</th>
<th>App Name</th>
<th>Auth Key</th>
<th>Status</th>
<th>Created</th>
<th>Updated</th>
<th width="300px">Action</th>
</tr>
</table>
</div>
</div>
<div class="modal fade" id="modalAddAccount" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<form method="POST" action="" id="addInfsAccount"/>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Infusionsoft Account</h4>
</div>
<div class="modal-body">
<p class="small">Fill up the form to add a new Infusionsoft Account.</p>
<br/>
<div class="form-group row">
<div class="col-md-8 col-md-offset-2">
<input id="appName" type="text" required placeholder="App Name e.g l328" class="form-control" name="appName">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add Account</button>
</div>
</div>
</form>
</div>
</div>
<app-legend/>
</div>
</div>
</template>
<script>
import Legend from "./Legend";
import NavBar from "../layouts/NavBar";
import SideBar from "../layouts/SideBar";
export default {
data() {
return {
infsModal: false,
}
},
created() {
},
components: {
'app-legend': Legend,
'nav-bar': NavBar,
'side-bar': SideBar,
},
methods: {
addInfusionsoft() {
$('#modalAddAccount').modal('show');
}
},
}
</script>
I'm using this template for the project https://www.themeineed.com/downloads/klorofil-free-bootstrap-admin-template/, I kept everything as default and didn't have any major modifications with the bootstrap classes. If I use jquery function to call the modal it will show correctly, however moving the modal to another template and calling is by using v-model and v-if, nothing really happens. Please see sample below
parent template
<template>
<div class="main">
<div class="container-fluid" style="padding-top: 2.5%">
<h4 class="page-title"><i class="lnr lnr-funnel"> </i> Infusionsoft Accounts
<button #click="infsModal = true" class="btn btn-xs btn-success" ><i class="lnr lnr-plus-circle"> </i> New </button>
</h4>
<div class="row">
<div class="col-md-12">
<table class="table table-responsive table-bordered table-striped">
<tr>
<th>ID</th>
<th>App Name</th>
<th>Auth Key</th>
<th>Status</th>
<th>Created</th>
<th>Updated</th>
<th width="300px">Action</th>
</tr>
</table>
</div>
</div>
<div v-if="infsModal">
<div class="modal fade" id="modalAddAccount" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<form method="POST" action="" id="addInfsAccount"/>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Infusionsoft Account</h4>
</div>
<div class="modal-body">
<p class="small">Fill up the form to add a new Infusionsoft Account.</p>
<br/>
<div class="form-group row">
<div class="col-md-8 col-md-offset-2">
<input id="appName" type="text" required placeholder="App Name e.g l328" class="form-control" name="appName">
<span v-if="false" span class="invalid-feedback">
<strong>Error</strong>
</span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add Account</button>
</div>
</div>
</form>
</div>
</div>
</div>
<app-legend/>
</div>
</div>
</template>
<script>
import Legend from "./Legend";
import NavBar from "../layouts/NavBar";
import SideBar from "../layouts/SideBar";
import InfusionsoftAdd from "../infusionsoft/InfusionsoftAdd";
export default {
data() {
return {
infsModal: false,
}
},
created() {
},
components: {
'app-legend': Legend,
'nav-bar': NavBar,
'side-bar': SideBar,
'infs-modal': InfusionsoftAdd,
},
methods: {
addInfusionsoft() {
//this.$router.push('/infusionsoft')
}
},
}
</script>
this is the modal:
<template>
<div v-if="dialog">
<transition name="modal">
<div class="modal fade" id="modalAddAccount" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<form method="POST" action="" id="addInfsAccount"/>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Infusionsoft Account</h4>
</div>
<div class="modal-body">
<p class="small">Fill up the form to add a new Infusionsoft Account.</p>
<br/>
<div class="form-group row">
<div class="col-md-8 col-md-offset-2">
<input id="appName" type="text" required placeholder="App Name e.g l328" class="form-control" name="appName">
<span v-if="false" span class="invalid-feedback">
<strong>Error</strong>
</span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add Account</button>
</div>
</div>
</form>
</div>
</div>
</transition>
</div>
</template>
<script>
export default {
data() {
return {
dialog: true
}
},
methods: {
back() {
//this.$router.back();
}
}
}
</script>
Is there anything I'm doing wrong?
When you set infsModal to true, all that's happening is that you're including the modal code but you're still not displaying the modal. You can still use jQuery here if you'd like, no reason not to. You can remove the infsModal variable since it's not needed (the modal won't display even if that's set to true... you still need to tell Bootstrap to actually show the modal). If you want to get away from jQuery, a solid option is Bootstrap-Vue https://bootstrap-vue.org/docs/components/modal ... let me know if that helps!
is it possible to use the index view to perform update/edit at the same time using modal form? i have index view with table displaying the data,and inside the table it has button named [edit and delete] now i want to perform edit/update once the edit button is click then modal form will come out..? but whenever is use the modal form it will show error like this image.
This is my Controller:
public function show_setup()
{
$batch=Batch::all();
return view('setup.show_batch',compact('batch'));
}
public function edit_batch(request $request)
{
$batch = Batch::find ($request->id);
$batch->batch_name = $request->batch_name;
$batch->save();
return redirect()->back();
}
My view
<form>
<div class="form-group">
<table class="table table-hover table-bordered" id="table">
<tr>
<th>Batch</th>
<th>Action</th>
</tr>
#foreach($batch as $bt)
<tr>
<td>{{$bt->batch_name}}</td>
<td>
Edit
Delete
</td>
</tr>
#endforeach
</table>
</div>
</form> <!-- Modal-->
<div id="edit_batch" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" class="modal fade text-left">
<div role="document" class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 id="exampleModalLabel" class="modal-title">Edit Batch</h5>
<button type="button" data-dismiss="modal" aria-label="Close" class="close">
<span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form action="setup/batch/edit" method="POST">
{{csrf_field()}}
{{ method_field('PUT') }}
<div class="form-group">
<label>School Year</label>
<input type="text" placeholder="School Year" name="batch_name" value="{{$batch->batch_name}}" class="form-control" autocomplete="off">
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-secondary">Close</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</form>
</div>
</div>
</div>
<!--End batch Modal-->
The problem is that you want to get the batch_name from the collection $batch you have to pass the data you want using the javaScript the data you need are the id and the batch_name
Here is an example :
<form>
<div class="form-group">
<table class="table table-hover table-bordered" id="table">
<tr>
<th>Batch</th>
<th>Action</th>
</tr>
#foreach($batch as $bt)
<tr>
<td>{{$bt->batch_name}}</td>
<td>
Edit
Delete
</td>
</tr>
#endforeach
</table>
</div>
</form>
<!-- Modal-->
<div id="edit_batch" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" class="modal fade text-left">
<div role="document" class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 id="exampleModalLabel" class="modal-title">Edit Batch</h5>
<button type="button" data-dismiss="modal" aria-label="Close" class="close">
<span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form action="setup/batch/edit" method="POST">
{{csrf_field()}}
{{ method_field('PUT') }}
<input id="batch_id" type="hidden" name="id">
<div class="form-group">
<label>School Year</label>
<input id="batch_name" type="text" placeholder="School Year" name="batch_name" class="form-control" autocomplete="off">
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-secondary">Close</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!--End batch Modal-->
<script type="text/javascript">
$('.editBtn').on('click',function(e)
{
var link = $(this);
batch_id = link.data("id");
batch_name = link.data("batch_name");
$("#batch_id").val(batch_id);
$("#batch_name").val(batch_name);
});
</script>
I have create a searsh view and i can go to the values in another page and it's working fine , I can see my values but when I have added pagination it's working again but when I press button number 2 of paination it's not working and it give me an error :
MethodNotAllowedHttpException in RouteCollection.php line 251
at RouteCollection->methodNotAllowed(array('POST')) ...
My functions:
public function searsh()
{
return view('resultats.recherche');
}
public function show(Request $request)
{
$this->validate($request, [
'cne' => 'required|integer',
]);
$exams = Exam::where('cne', $request->cne)->paginate(4);
return view('resultats.index', compact('exams'));
}
and this is my routes:
The first one that make me send a searsh request in db
Route::get('/chercher', 'ExamsController#searsh')->name('display-cne-search');
Route::post('/resultat', 'ExamsController#show')->name('show-exams-cne-results');
and this is my view
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<style>
body{
background-repeat:no-repeat;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
background-position:center;
background: url('image/t10.jpg');
}
.bling{
background:url('image/background.jpg');
}
</style>
#extends('layouts.master')
#section('content')
#if($exams->isEmpty())
<div style="width:100%;height:100px;background-color:white">
<center>
<p style="margin-top:50px;">Le cne que vous avez choisi est incorrecte entrer un autre cne svp <a href="/chercher">
<br>
<button style="margin-top:5px"class="btn btn-primary">Par ici</button></a>
</p>
</center>
</div>
#else
<div class="container">
<div class="row">
<center><div class="col-md-12">
<div style="border-radius:5px;background:url('image/background.jpg')">
<center>
<h2 style="color:white;font-weight: bold;padding-top:5px;padding-bottom:5px;" > Historique des résultats de l'étudiant(e) {{$prenom}} {{$nom}} <br>
CNE {{$cne}}</h2>
</center>
</div>
<center><table style="background-color:white;border-radius:5px;" class="table">
<head>
<tr>
<th>Matiére</th>
<th>Note</th>
<th>Semestre</th>
<th>Session</th>
<th>Année</th>
<th>Le prof vous a peut-être laissé une remarque</th>
<th>Demande Vérification</th>
</tr>
</head>
<body>
#foreach($exams as $exam)
<tr class="{{$loop->index % 2==0 ? 'bling' : ''}}">
<td>{{ $exam->matiere}}</td>
<td>{{ $exam->note}}</td>
<td>{{ $exam->sem}}</td>
<td>{{ $exam->ses}}</td>
<td>{{ $exam->an}}</td>
<td>
<center>
<button type="button" value="{{$exam->remarque}}" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter" onClick="document.getElementById('remarque').innerHTML=this.value">
Remarque
</button>
</center>
</td>
<td>
#if(!$exam->verification)
<button class="btn btn-succees" onclick="document.getElementById('verification-form-{{$exam->id}}').submit();" >
Vérifier la note
</button>
<form id="verification-form-{{ $exam->id }}" action="{{ route('display-num-search', $exam ) }}" method="post">
{{ csrf_field() }}
</form>
#elseif($exam->verification->etat=="En attente")
<center> <a title="{{$exam->verification->etat}}" style="background-color:orange" class="btn-floating btn pulse"></a></center></p>
#else
<center><p> Verifié <i title="Note verifié par le professeur" class="fas fa-user-check"></i></p></center>
#endif
</td>
</tr>
#endforeach
<center>{{ $exams->links()}}</center>
</body>
</table></center>
<!-- modal remarque -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Remarque du prof</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div style="font-size:15px;font-weight: bold;" id="remarque"></div>
</div>
</div>
</div>
</div>
</div></center>
</div>
</div>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous">
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.dropdown-trigger');
var instances = M.Dropdown.init(elems, options);
});
// Or with jQuery
$('.dropdown-trigger').dropdown();
</script>
#endif
#endsection
POST requires a CSRF token everytime to process the request.
So, for performing a search and getting the pagination you can set the route as:
Route::any('/resultat', 'ExamsController#show')->name('show-exams-cne-results');
By this method, the first search performed is handled with POST method with the CSRF token and later for paginations, GET method is used.
EDIT: To make searches:
Change your route to GET.
Route::get('/resultat', 'ExamsController#show')->name('show-exams-cne-results');
Also, change the form method to GET
<form id="verification-form-{{ $exam->id }}" action="{{ route('display-num-search', $exam ) }}" method="GET">
I'm using entrust package for roles management , i have impleted that in my project based on the steps which mentioned in github , it's working fine but for assigning roles to user page we are getting values from two queries which i mentioned below , if the user list goes upto 100 how can i get user details easily , i want datatables for this view can anyone please help me to view as datatables format and i already configured yajra datatables for my project , it is working for other pages, we are using https://github.com/Zizaco/entrust
Controller.php
public function index()
{
$company_id=Auth::user()->company_id;
$users=User::where('company_id',$company_id)->get();
$allRoles=Role::where('company_id',$company_id)->get();
return view('usersroles.index',compact(['users','allRoles']));
}
view.blade.php
<table class="table table-bordered" >
<tr class="thead-cls">
<th class="center">Name</th>
<th class="center">Employee Id</th>
<th class="center">Roles</th>
<th class="center">Action</th>
</tr>
#forelse($users as $user)
<tr>
<td class="center">{{$user->name}}</td>
<td class="center">{{$user->emp_id}}</td>
<td class="center">
#foreach( $user->roles as $role)
{{$role->name}},
#endforeach
</td>
<td class="center">
#permission('users-roles-edit')
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-add" data-toggle="modal" data-target="#myModal-{{$user->id}}">
Edit
</button>
#endrole
<!-- Modal -->
<div class="modal fade" id="myModal-{{$user->id}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"> Editing<b> {{$user->name}}'s</b> Role</h4>
</div>
<div class="modal-body">
<form action="{{route('usersroles.update',$user->id)}}" method="post" role="form" id="role-form-{{$user->id}}">
{{csrf_field()}}
{{method_field('PATCH')}}
<div class="form-group">
<select name="roles[]" multiple required="">
#foreach($allRoles as $role)
<option value="{{$role->id}}">{{$role->name}}</option>
#endforeach
</select>
</div>
{{--<button type="submit" class="btn btn-primary">Submit</button>--}}
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-add" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary btn-add" onclick="$('#role-form-{{$user->id}}').submit()">Save changes</button>
</div>
</div>
</div>
</div>
</td>
</tr>
#empty
<td>No users</td>
#endforelse
</table>
[![Need Datatables for this view][1]][1]
Just add this piece of code in your view with jQuery:
$(document).ready(function(){
$('#myTable').DataTable();
});
#myTable is the id of your table. For more info, read the documentation.
I'm coding a single crud application, and i need to use two controllers in one view, but i dont know how.
When the user press the "Add Colaborador" button, the application needs to search the "Função" registers, and show in a select(Html function). (One "Colaborador" have one "Funcao").
Here's my code:
http://pastebin.com/uUzE5K28
For use the , i need to change the controller to "funcoesController", then come back to "colaboradoresController".
Sorry for bad english!
Angular can nest controllers. So you can embed one controller in another controller. Within the nested controller, you can access either controller.
<!DOCTYPE html>
<html lang="pt-br" ng-app="registrosGerais">
<head>
<title>Sistema Pronatec</title>
<!-- Load Bootstrap CSS -->
<link href="<?= asset('css/bootstrap.min.css') ?>" rel="stylesheet">
</head>
<body>
<h2>Gerenciamento de Colaboradores</h2>
<div ng-controller="colaboradoresController">
<!-- Nest second controller -->
<div ng-controller="funcoesController">
<button id="btn-add" class="btn btn-primary btn-xs" ng-click="toggle('add', 0)">Novo Colaborador</button>
<!-- Table-to-load-the-data Part -->
<table class="table">
<thead>
<tr>
<th>ID</th>
<th>Nome</th>
<th>Função</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="clb in tbcolaborador">
<td>{{clb.id}} </td>
<td>{{ clb.nome }}</td>
<td>{{ clb.funcao_id}}</td>
<td>
<button class="btn btn-default btn-xs btn-detail" ng-click="toggle('edit', clb.id)">Editar</button>
<button class="btn btn-danger btn-xs btn-delete" ng-click="confirmDelete(clb.id)">Remover</button>
<button class="btn btn-info btn-xs btn-detail" ng-click="addConta(clb.id)">Adicionar Conta Banco</button>
</td>
</tr>
</tbody>
</table>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">{{form_title}}</h4>
</div>
<div class="modal-body">
<form name="frmColaboradores" class="form-horizontal" novalidate="">
<div class="form-group error">
<label for="inputNome" class="col-sm-3 control-label">Nome</label>
<div class="col-sm-9">
<input type="text" class="form-control has-error" id="nome" name="nome" placeholder="Nome completo" value="{{nome}}" ng-model="colaborador.nome" ng-required="true">
<span class="help-inline" ng-show="frmColaboradores.nome.$invalid && frmColaboradores.nome.$touched">Nome é obrigatório</span>
</div>
</div>
<div class="form-group error">
<label for="inputFuncao" class="col-sm-3 control-label">Função</label>
<div class="col-sm-9">
<select>
<option ng-repeat = "clb in tbfuncao" value "{{ clb.id }}"> {{ clb.nome }} </option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="btn-save" ng-click="saveColaborador(modalstate, id)" ng-disabled="frmColaboradores.$invalid">Salvar</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Load Javascript Libraries (AngularJS, JQuery, Bootstrap) -->
<script src="<?= asset('app/lib/angular/angular.js') ?>"></script>
<script src="<?= asset('js/jquery.min.js') ?>"></script>
<script src="<?= asset('js/bootstrap.min.js') ?>"></script>
<!-- AngularJS Application Scripts -->
<script src="<?= asset('app/app.js') ?>"></script>
<script src="<?= asset('app/controllers/colaboradores.js') ?>"></script>
</body>
You should not access two controllers from the same view. This kind of cross dependency will most likely drive you crazy when one change things in one controller and start noticing crashes in unexpected places.
Your Laravel controller can pass all needed data to your view, including the lookup data as an additional array variable. That's the simplest way.
Laravel has many different ways to pass additional data to your views. Besides direct variable references, you can create View Composers or inject service providers into your views with Service Injection (in Laravel 5.2). You would want to choose this kind of solutions if you need the same reference data in multiple places to keep the code DRY.