Posts

Showing posts from May, 2021

Export CSV File

step-1  composer requires maatwebsite/excel Step-2 make Database Connection step-3 make model can make any model  which data required in excel file.in my case model is Product.php step-3 config/app.php 'providers'=> [   Maatwebite\Excel\ ExcelServiceProvider :: class ] 'aliases'=> [   'Excel' =>Maatwebite\Excel\Facades\ Excel :: class ] step-4 make controller can make any model  which data required in excel file.in my case model is  ProductController.php namespace   App\Http\Controllers ; use  App\Models\ Product ; use   Excel ; use  Illuminate\Http\ Request ; use  Illuminate\Support\Facades\ Validator ; use  Maatwebsite\Excel\Concerns\ FromCollection ; class   ProductController   extends   Controller {           public   function   exportData ()     {          return   Excel :: downloa...

Laravel Passpost

  Laravel passport What is Passport? APIs typically use tokens to authenticate users and do not maintain session state between requests. Laravel makes API authentication a breeze using Laravel Passport, which provides a full OAuth2 server implementation for your Laravel application development in a matter of minutes. You have to just follow a few steps to get following web services Login API Register API Details API Getting Started   Step 1: Install Package composer require laravel/passport open config/app.php file and add service provider. config / app . php 'providers' => [ Laravel \P assport \P assportServiceProvider :: class , ] , Step 2: Run Migration and Install php artisan migrate php artisan passport: install Step 3: Passport Configuration app/User.php < ? php namespace App ; use Laravel \P assport \H asApiTokens ; use Illuminate \N otifications \N otifiable ; use Illuminate \F oundation \A uth \U ser as Authenticatable ; class User extends ...