zahidgani

zahidgani

Member Since 2 Years Ago

Delhi

Php,Laravel Developer at Faridabad

Experience Points 2,100
Experience Level 1

2,900 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 1
Lessons
Completed
Best Reply Awards 2
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

22 Mar
1 year ago

zahidgani started a new conversation How To Add Custom Js In Webmix Or Custom.js To App.js

resource/asstes/js/frontpage/header.js

function myFunction() { alert("I am an alert box!") } function helpp() { alert("I am an alert box!") } $(document).ready(function() { myFunction(); });

resource/asstes/js/frontpage/app.js require('./bootstrap'); require('./frontpage/header'); require("../../../node_modules/jquery");

then myFunction message is working but

when i used this helpp function in

index.blade.php

Test

then it not working please suggest

27 Jul
1 year ago

zahidgani started a new conversation How To Use Paginate And Search Filter Both Using Laravel With Jquery Ajax

Hi.

I have used

$data=User::paginate(10);

foreach($data as $rs) { echo $rs->name; }

$data->link();

this code is working fine,but when I used this code in

$.ajax({ url:"get-data", type:post, data:form, success:function(msg) { $("#data").html(msg); }

});

then it not working.

Please share complete code how to used...

zahidgani left a reply on How To Use Different Password Column In Default LoginController In Laravel For Login

Thanks Cinek

Now its working fine...................

26 Jul
1 year ago

zahidgani started a new conversation How To Use Different Password Column In Default LoginController In Laravel For Login

Hi I have to use pwd field in Login controller where to used .I have try more code but not working.

20 Jun
2 years ago

zahidgani started a new conversation How To Send Mail Through Smtp. Without Gmail Server | Zahid Gani

I want to send mail through smtp. Here more example available to send mail through smtp.gmail.com but not added personal smtp.domain.com

when i integrate then it not working.. please help anyone.?

zahidgani left a reply on How To Send Mail With Smtp In Laravel

No its not working

zahidgani left a reply on SMTP Mail Is Not Working

Hi I dont want to use gmail but personall email to send mail throuh smtp how to used

zahidgani started a new conversation How To Send Mail With Smtp In Laravel

Hi I have used

Code 1: MAIL_DRIVER=smtp MAIL_HOST=smtp.xterna.se MAIL_PORT=587 [email protected] MAIL_PASSWORD=mypassword MAIL_ENCRYPTION=yes

Not working Error: Connection could not be established with host smtp.xterna.se [Unable to find the socket transport "yes" - did you forget to enable it when you configured PHP? #32657]

Code: 2

MAIL_DRIVER=sendmail MAIL_HOST=smtp.xterna.se MAIL_PORT=465 [email protected] MAIL_PASSWORD=mypassword MAIL_ENCRYPTION=yes

Not working: Error: Expected response code 220 but got code "", with message ""

I want to integrate my personal website email account to send mail.when w used phpmailer in normal php then it work but in laravel not working please guide

11 Apr
2 years ago

zahidgani started a new conversation Php Artisan Generate Error Closure::__set_state()

[Symfony\Component\Debug\Exception\FatalThrowableError] Call to undefined method Closure::__set_state()

I have used laravel 5.4 when I try to use php artisan then it generate error.

27 Mar
2 years ago

zahidgani started a new conversation How To Display Browser Notifications From Web Application In Laralve 5.3 Or 4

Hi I want to display browser notification of Latest Product. How to create please help I have make in php easily..

Here is eample og Php: http://www.9lessons.info/2015/11/display-browser-notifications-from-web.html

but how to develop in laravel.

23 Mar
2 years ago

zahidgani left a reply on Mysql Date_format In Query Builder In Laravel 5.0

Between Search

whereBetween(DB::raw("DATE_FORMAT(created_at,'%Y-%m-%d')"), array($_REQUEST["date_from"], $_REQUEST["date_to"]));

Single Search where(DB::raw("DATE_FORMAT(created_at,'%Y-%m-%d')"), $_REQUEST["date_from"]);

Show Query

DATE_FORMAT(created_at,'%b %d, %Y') as start_date

18 Mar
2 years ago

zahidgani left a reply on How To Create User Role Based Access Control In Laravel 5.4

When we open roles to create role it generate errors ErrorException in be510f6d953dd674742e1054840a61fce5e2949e.php line 9: Parse error: syntax error, unexpected ''role-create'' (T_CONSTANT_ENCAPSED_STRING) (View: /var/www/html/laravel/fullacl/resources/views/roles/index.blade.php)

index.blade.php @extends('layouts.app')

@section('content')

Role Management

@permission('role-create') Create New Role @endpermission @if ($message = Session::get('success'))

{{ $message }}

@endif No Name Description Action @foreach ($roles as $key => $role) {{ ++$i }} {{ $role->display_name }} {{ $role->description }} Show @permission('role-edit') Edit @endpermission @permission('role-delete') {!! Form::open(['method' => 'DELETE','route' => ['roles.destroy', $role->id],'style'=>'display:inline']) !!} {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!} {!! Form::close() !!} @endpermission @endforeach {!! $roles->render() !!} @endsection

RoleController.php

zahidgani started a new conversation How To Create User Role Based Access Control In Laravel 5.4

Hi I want to create user role based control

Module[Manager User,Manage Product,Manage Role] Module Permission[Add,Edit,Delete,View]

if user has Manager user Module then he can do only acroding to setted permission like if they has Add Permission On Manager User then he only add new user not view,show and edit.

Default User Setted By Developer [email protected] and he has full controll.

I have this tutorials but not working fine please suggest.

http://itsolutionstuff.com/post/laravel-52-user-acl-roles-and-permissions-with-middleware-using-entrust-from-scratch-tutorialexample.html

14 Mar
2 years ago

zahidgani left a reply on How To Make Modules Or Packages In Laravel 5.3 Or 4.

here we have to putt all the laravel code or my own packages folder...

i have make folder in main root of project name(mymodule) app bootstrap config packages laravelcms shopping src please suggest i am new in package development..

zahidgani left a reply on How To Make Modules Or Packages In Laravel 5.3 Or 4.

i have make small package but i am not getting reuse this package in another project.

zahidgani started a new conversation How To Make Modules Or Packages In Laravel 5.3 Or 4.

How to make own module in laravel

We want to make small app like add,delete,list product(Category,Name,Price,Description) in one app and whenever work any another project then we can use this module. please help.

02 Mar
2 years ago

zahidgani started a new conversation How To Upload File Private Mode And Retrive By Generated Url With Expired Time In Aws S3 In Laravel 5.3 Or 5.4

Here is complete code:

upload file in aws s3 from laravel 5.3 or 5.4

Run: composer require league/flysystem-aws-s3-v3 set in config/filesystems.php

    's3' => [
        'driver' => 's3',
        'key' => 'your_generated_key',
        'secret' => 'your_generated_secret',
        'region' => 'us-east-1',
        'bucket' => 'your_bucket_folder',//folder will be public permission
    ],

run: php artisan config:cache

make controller: S3ImageController.php

make route: Route::get('s3-image-upload','[email protected]'); Route::post('s3-image-upload','[email protected]');

namespace App\Http\Controllers\classes;

use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Contracts\Filesystem\Filesystem; class S3ImageController extends Controller { //this code for save data with private not public if you save public then not secure your file every one can see public function imageUploadPost(Request $request) { $this->validate($request, [ 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg,mp4|max:2048', ]);

    $imageName = 'SampleVideo1.'.$request->image->getClientOriginalExtension();
    $image = $request->file('image');
    //$t = \Storage::disk('s3')->put($imageName, file_get_contents($image), 'public');
    $t = \Storage::disk('s3')->put($imageName, file_get_contents($image), 'private');
    $imageName = \Storage::disk('s3')->url($imageName);

    return back()
        ->with('success','Image Uploaded successfully.')
        ->with('path',$imageName);
}
public function imageUpload()
    {
        
        //this code for generate new signed url of your file
        $value="SampleVideo1.mp4";
        $disk = \Storage::disk('s3');
        if ($disk->exists($value)) 
        {
        $command = $disk->getDriver()->getAdapter()->getClient()->getCommand('GetObject', [
            'Bucket'                     => \Config::get('filesystems.disks.s3.bucket'),
            'Key'                        => $value,
            //'ResponseContentDisposition' => 'attachment;'//for download
        ]);

        $request = $disk->getDriver()->getAdapter()->getClient()->createPresignedRequest($command, '+10 minutes');
        //$request = $disk->getDriver()->getAdapter()->getClient()->createPresignedRequest($command, '+15 seconds');

        $generate_url = $request->getUri();
        echo $generate_url;
        }

     //this code for show form  
     return view('admin.image-upload');

    }

}

public function imageUpload() { //Retrive generated url of private file or video (i have upload one video in aws server where store this name but not directly open because private permission $value="SampleVideo1.mp4"; $disk = \Storage::disk('s3'); if ($disk->exists($value)) { $command = $disk->getDriver()->getAdapter()->getClient()->getCommand('GetObject', [ 'Bucket' => \Config::get('filesystems.disks.s3.bucket'), 'Key' => $value, //'ResponseContentDisposition' => 'attachment;'//for download ]);

    $request = $disk->getDriver()->getAdapter()->getClient()->createPresignedRequest($command, '+10 minutes');
    //$request = $disk->getDriver()->getAdapter()->getClient()->createPresignedRequest($command, '+15 seconds');

    $generate_url = $request->getUri();
    echo $generate_url;
}

//now you can access your generated url }

working fine.

10 Jan
2 years ago

zahidgani left a reply on How To Connect Google Drive To Upload And Download File Using Laravel 5.3

I solved the problems thank you friends.@martinbean

its working fine now.

zahidgani left a reply on MySQL Error (Encoding) General Error: 1366 Incorrect String Value

'strict' => false, 'engine' => null,

zahidgani left a reply on Datatables Raw Query Giving SQL Error

$users = App\User::selectRaw("users.created_at as add_time,users.email,users.first_name,users.last_name,users.status,users.business_type,users_info.*")->orderBy('users.id','DESC') ->join('users_info', 'users.id', '=', 'users_info.user_id') ->where([ ['users.role_id','=','Admin'],['users.status','<>','Pending']]) ->where(function ($query) { if($_REQUEST["search_text"]!="") { $query->Where('users.first_name', 'like', "%{$_REQUEST["search_text"]}%") ->orWhere('users.last_name', 'like', "%{$_REQUEST["search_text"]}%") ->orWhere('users_info.contact_no', 'like', "%{$_REQUEST["search_text"]}%"); } })

     ->where(function ($query) 
        {   if($_REQUEST["status"]!="")
            {
                $query->Where('users.status', '=',$_REQUEST["status"]);
                
            }
        })              
    ->paginate(10, ['*'], 'activeusers');
    

zahidgani left a reply on Display Dynamic Search Results With AJAX

in your route page Route::get("users","[email protected]");

in your view page $.ajax({ type: "POST", url: "{{url('users')}}", data: "", beforeSend: function(){ $("html, body").animate({ scrollTop: 200 }, "slow"); $('#txtHint').html("Loadinf..."); }, success: function(msg){ $('#txtHint').html(msg); } });

here display data //in your controller page public function listData() {

$users = App\User::selectRaw("users.created_at as add_time,users.email,users.first_name,users.last_name,users.status,users.business_type,users_info.*")->orderBy('users.id','DESC') ->join('users_info', 'users.id', '=', 'users_info.user_id') ->where([ ['users.role_id','=','Admin'],['users.status','<>','Pending']]) ->where(function ($query) { if($_REQUEST["search_text"]!="") { $query->Where('users.first_name', 'like', "%{$_REQUEST["search_text"]}%") ->orWhere('users.last_name', 'like', "%{$_REQUEST["search_text"]}%") ->orWhere('users_info.contact_no', 'like', "%{$_REQUEST["search_text"]}%"); } })

     ->where(function ($query) 
        {   if($_REQUEST["status"]!="")
            {
                $query->Where('users.status', '=',$_REQUEST["status"]);
                
            }
        })              
    ->paginate(10, ['*'], 'activeusers');
    
    $list="";
    foreach($users as $rs)
    {
        $list.=$rs->first_name;
    }
    echo $list;

}

zahidgani left a reply on User Registration Page

$this->validate($request, [ 'first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|min:5|confirmed', 'image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]);

      $first_name      = $request->first_name; 
      $last_name       = $request->last_name; 
      $email      = $request->email;
      $password      = $request->password;  
     
      $old_logo    = $request->old_logo;
      $logo="";
      if($request->image)
      {
        $imageName = time().'.'.$request->image->getClientOriginalExtension();
        $request->image->move(public_path('upload'), $imageName);
        $logo = $imageName;
        chmod('public/upload/'.$logo, 0777);          
      }
      else
      {
        $logo=$old_logo;
      }
            $stm1=User::find($user_id);
            $stm1->first_name=$first_name; 
            $stm1->last_name=$last_name;
            $stm1->email=$email;
            $stm1->logo=$logo;
            $stm1->password=bcrypt($password);
            $stm1->created_at=$time;
            $stm1->save();

        return redirect("login")->with("message","Account Successfully created");

zahidgani started a new conversation How To Connect Google Drive To Upload And Download File Using Laravel 5.3

Hi. Please help me to out how to connect google drive for upload and download file from google server. i have created google application from console.google the provide client key and client secret. i have used following code but return going some error.please fixed.

01 Dec
2 years ago

zahidgani left a reply on How To Get Users Register Over Invitation Link Sent To Email?

//In your controller get data fromdatabase and put whatever you want to make design in message variable and send

//First set Middleware/VerifyCsrfToken.php

class VerifyCsrfToken extends BaseVerifier { /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = ['verify']; }

//this work for remove token permission for submitting form

//in your controller page work following.

 use App\Mail\VerifyEmail;
 use Mail;

 $rs=DB::select("select * from users where id=1");
 $message="";
 $message.="<h2>HI ".$rs[0]->name."</h2>h2>";
 $message.="<h2>Please verify <a href='http://www.yourdomain.com/verify/".$rs[0]->email."'>Verify</a> </h2>h2>";
  $subj    = $mailer->subject;

   $data = 
   [
      'subject' => $subj,
      'from'    => '[email protected]',
      'to'      => '[email protected]',
   ];
    

    Mail::send(array(), $data, function ($msg) use ($message,$data) 
    {
      $msg->from($data['from'], 'Avya Tech');
      $msg->to($data['to'])->subject($data['subject'])
      ->setBody($message, 'text/html');
    });