yajra-datatable

Use of undefined constant OCI_CRED_EXT - assumed 'OCI_CRED_EXT' laravel

99封情书 提交于 2021-01-29 18:21:04
问题 I'm trying to connect oracle database to my laravel application using this package: https://github.com/yajra/laravel-oci8 but having error with the external connection, this is the error: Here the line of error in package: https://github.com/yajra/laravel-oci8/blob/5.8/src/Oci8/Connectors/OracleConnector.php#L35 System details Operating System: macOS Mojave Version 10.14.4 (18E226) PHP Version: 7.3 Laravel Version: 5.8.* Laravel-OCI8 Version: 5.8.* Anyone can help me please? 回答1: Looks like

CSRF on YAJRA datatable Laravel5.5 not working

試著忘記壹切 提交于 2020-01-11 12:45:09
问题 I have this code where I needed to store in a variable so I display it in view, I've tried different approach of packing the "Form header" and using CSRF is not working $return = '<form method="post" action="/procurement/add-product"> '.{{ csrf_token() }}.' <input type="hidden" name= "product_id" value=".$row->id."> <input type="text" name="product_qty" class="form-control"> <button type="submit" class="btn btn-primary btn-block">Add Item</button> </form>'; return $return; Here is my route

Yajra data table using search and custom filter together

泪湿孤枕 提交于 2019-12-25 03:02:53
问题 Laravel: 5.6.39 PHP: 7.2.10 Yajra Table: 8.0 Sample code $(document).ready( function() { var url = "{{ url('/admin/videos') }}"; $(function() { var oTable = $('#admin-videos').DataTable({ dom: "<'row'<'col-xs-12'<'col-xs-6'l><'col-xs-6'p>>r>"+ "<'row'<'col-xs-12't>>"+ "<'row'<'col-xs-12'<'col-xs-6'i><'col-xs-6'p>>>", processing: true, serverSide: true, ajax: { url: url, data: function (d) { d.category = $("#category option:selected").val(); d.language = $("#language option:selected").val(); }

How to optimize a big query?

僤鯓⒐⒋嵵緔 提交于 2019-12-23 03:37:15
问题 I have a table with 10000 users and there is a relationship with work_hours table. This is my User Model and how I get sum of work hours. protected $appends = ['sum_work_hours']; public function work_hours() { return $this->hasMany(WorkHour::class); } public function getSumWorkHoursAttribute() { return $this->work_hours->sum('hours_total'); } And I made a query to show all users and their sum of work hours like this: public function getHoursDatatable() { $users = User::with('work_hours')->get

Yajra Datatable custom Model Attribute

二次信任 提交于 2019-12-23 02:42:13
问题 I'm using Yajra Datatables for Laravel and it won't show the custom attribute for my User model. This is my User model: protected $appends = ['sum_work_hours']; public function work_hours() { return $this->hasMany(WorkHour::class); } public function getSumWorkHoursAttribute() { return $this->work_hours->sum('hours_total'); } And this is in Controller: public function showHours() { return view('hour'); } public function getHoursDatatable() { $users = User::select(['name', 'email', 'sum_work

DataTables json is not processed (in Laravel)

纵然是瞬间 提交于 2019-12-14 02:31:47
问题 Datatables does nothing with the json it requested I am using Yajra's Datatables to populate my table and I did everything by the book. The controller is set up correctly, the routes are good (if I enter the route designated to the controller function which creates the Database, I can see the desired json in the desired format: {"draw":0, "recordsTotal":44, "recordsFiltered":44, "data":[{ "agency":"agency", "number":"20966512", "name":"Name John", "value":"28.22", }] } This is the .js code

how to show image in yajra datatable column , laravel5.3

不羁岁月 提交于 2019-12-11 03:38:48
问题 i am adding a column in datatable for image like this : ->addColumn('product_brand_logo', function ($product_brand) { return '<img src="{{ URL::to('upload/image')'.$img->image.'" border="0" width="40" class="img-rounded" align="center" />'; its not working the output in inspect | {{ URL::to('upload/image')imagename.png}}| using laravel 5.3 , yajra datatable 6.0 回答1: If you are use datatable 7.0 Then you can use rawColumns return DataTables::of($artists)->addColumn('image', function ($artist)

Yajra Datatable custom Model Attribute

北城以北 提交于 2019-12-07 07:50:41
I'm using Yajra Datatables for Laravel and it won't show the custom attribute for my User model. This is my User model: protected $appends = ['sum_work_hours']; public function work_hours() { return $this->hasMany(WorkHour::class); } public function getSumWorkHoursAttribute() { return $this->work_hours->sum('hours_total'); } And this is in Controller: public function showHours() { return view('hour'); } public function getHoursDatatable() { $users = User::select(['name', 'email', 'sum_work_hours']); return Datatables::of($users)->make(); } And in view: <link rel="stylesheet" href="https://cdn

CSRF on YAJRA datatable Laravel5.5 not working

一世执手 提交于 2019-12-02 07:50:58
I have this code where I needed to store in a variable so I display it in view, I've tried different approach of packing the "Form header" and using CSRF is not working $return = '<form method="post" action="/procurement/add-product"> '.{{ csrf_token() }}.' <input type="hidden" name= "product_id" value=".$row->id."> <input type="text" name="product_qty" class="form-control"> <button type="submit" class="btn btn-primary btn-block">Add Item</button> </form>'; return $return; Here is my route Route::post('/procurement/add-product','ProductController@addProcurementProduct'); Here is the JAvascript