Posts

Angular date picker using material

Image
Angular date picker using Angular material In this tutorial we will create a date picker using angular material package in angular We all might know about the angular material components , if not please checkout here   it is helpfull to design a attractive  ui/ux  components for angular projects we will use mtdatepicker component from angular material To create date picker. After successful installation of the angular project Follow the below steps Step 1: install the material , Cdk, Animation package by entering the following command ng add @angular/material @angular/animations @angular/cdk You will be prompted to select a material theme Yes/No Now we need to import the material to our app.module.ts //app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } f

Laravel Dompdf Installation

Image
 Laravel Dompdf     Installation   Dompdf is Laravel Package to generate Pdf files.  Follow the steps after successfull installation of Laravel into Your Computer   step 1 : Enter the following command, this will install the dompdf into your laravel project   composer require barryvdh/laravel-dompdf   step 2 : After Installation and updating composer add the following lines to register provider in bootstrap/app.php  $app->register(\Barryvdh\DomPDF\ServiceProvider::class);     Step 3 : Craete a blade file in views for pdf layout in my case its pdf.invoice.blade.php add the html code here Step 4 : Add the Following Code into your Controller   use Barryvdh\DomPDF\Facade\Pdf; $pdf=PDF::loadView('pdf.invoice', $data); return $pdf->download('invoice.pdf') ;     Now you can run the laravel project and route to the above contoller to Generate the PDF files

How to connect to mysql with laravel?

 How to connect to mysql with laravel? After successful installation of Laravel application We need to create database connection. In Laravel root folder you will find a file .env Its looks like below code APP_ENV=local APP_DEBUG=true APP_KEY=YOUR_API_KEY DB_HOST=YOUR_HOST DB_DATABASE=YOUR_DATABASE DB_USERNAME=YOUR_USERNAME DB_PASSWORD=YOUR_PASSWORD CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null In the .env file you will find a database connection details here you can give the required information about your database Or you can also find the database details in config/database.php file bases on your type of database you can give the required database information

How to join tables in laravel Eloquent

               Join multiple  tables using Laravel Eloquent join two tables in this example we will retrieve the data from   Post and Comments tables    $users = Post::join('comments', 'post.id', '=', 'comments.post_id')->get(['posts.*', 'comments.message']);   Join three tables in this example we will retrieve the data from Users and Post and Comments tables    $users = Users::join('posts', 'post.id', '=', 'user.post_id')->join('posts', 'post.id', '=', 'user.post_id')                          ->get(['posts.*', 'comments.message']);

Laravel Installation Using Composer

Image
Laravel Installation Using Composer Make sure you have installed composer in your machine To check Installation By using command prompt Enter C:\> Composer If Not Download From  https://getcomposer.org/download/  Go to the directory where you want to install Laravel and Enter  The Following Command   composer create-project laravel/laravel  first-laravel-app   Laravel project will be created with the folder name first-laravel-app To run laravel app go to inside the Laravel app folder and enter the following command php artisan serve     after the following command you see the above screen which will provide url to access your laravel project copy and paste on your browser you will see the laravel screen. Congratualtion you have successfully installed and run the laravel project