https://github.com/barryvdh/laravel-dompdf or https://laravel-excel.com/ 1 composer require barryvdh / laravel - dompdf 2 'providers' => [ .... Barryvdh\DomPDF\ ServiceProvider :: class, ], 3 'aliases' => [ .... 'PDF' => Barryvdh\DomPDF\ Facade :: class, ] 4 Route :: get ( '/customer/print-pdf' , [ 'as' => 'customer.printpdf, ' uses ' => ' CustomerController @ printPDF ']); 5 public function printPDF() { $userReport = array( [ ' name ' => ' vishnu ', ' email ' => ' xyz @ gmail . com ', ...
Posts
Showing posts from 2020
Laravel Query
- Get link
- X
- Other Apps
----------------------------------------------------------------------------------- public function getuser(){ $user = User::selectRaw('users.id,users.name,users.email') //->with('city.address') ->with(['city' => function ($query) { $query->select('user_city.id','user_city.userId','user_city.city_name'); $query->where('user_city.active',1); }, 'city.address' => function ($query) { $query->selec...
Model Query
- Get link
- X
- Other Apps
<?php defined('BASEPATH') or exit('No direct script access allowed'); class Test_model extends CI_Model { public $todays_date; public function __construct() { parent::__construct(); date_default_timezone_set('Asia/Dhaka'); $this->todays_date = date("Y-m-d")." 00:00:00"; } /* Insert Query */ public function create_data($data) { return $this->db->insert('tbl_form', $data); } public function create_data($data) { return $this->db->insert_batch('tbl_form', $data); } public function create_data($data) { $query = $this->db->insert('tbl_form', $data); ...
CRUD With Server-Side Validation | Codeigniter
- Get link
- X
- Other Apps
Crud.php Controller <?php defined('BASEPATH') or exit('No direct script access allowed'); class Crud extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('crud_model'); } public function index() { $data['formdatas'] = $this->crud_model->get_form_data(); $this->load->view('include/header'); $this->load->view('crud/crud',$data); $this->load->view('include/footer'); } public function create() { $data=[]; if(is_array($this->input->post()) && count($this->input->post())>0){ ...
Create Pagination using Codeigniter
- Get link
- X
- Other Apps
Pagination.php Controller <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Pagination extends CI_Controller { function __construct() { parent:: __construct(); $this->load->model('pagination_model'); $this->load->library('pagination'); } public function index() { $config=[ 'base_url' => base_url('Pagination/index'), 'per_page' => 3, 'total_rows' => $this->pagination_model->num_rows(), 'full_tag_open' => "<ul class='pagination'>", 'first_link' => false, 'last_link' => false, 'full_tag_close'=> "</ul>", 'next_tag_open' => "<li>", 'next_tag...
DataTables Server-side Processing in Codeigniter
- Get link
- X
- Other Apps
Form.php Controller <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Form extends CI_Controller { function __construct() { parent:: __construct(); $this->load->model('form_model'); } public function serverside() { $this->load->view('include/header'); $this->load->view('form/server-side-datatable'); $this->load->view('include/footer'); } public function get_form_data() { $columns = array( 0 => 'id', 1 => 'text', 2 => 'dropdown', 3 => 'radio', 4 => 'status', ...