Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.

gaan10

Experience

1,340

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 8 Lessons Completed
  • 0 Favorites

13th October, 2017

gaan10 started a new conversation Delay For My Pdf Download In Laravel Using Barryvdh/laravel-dompdf • 2 months ago

I am using barryvdh/laravel-dompdf for my pdf download in laravel.The download is ok but it takes nearly2-3 mins for the download.What could be the issue?

11th October, 2017

gaan10 started a new conversation I Want To Calculate The Total Total Bytes For Each Server.But Having Problem Dispalying It In My View.My Table Name Is Servers And Coumn Name Are Servers_name And Bytes. • 2 months ago

My controller code is:

$servers = DB::table("servers")->groupBy('server_name')->select('server_name')->sum('bytes');

My view is :

@foreach ($servers as $key => $value)

    <td>{{ $value->$bytes }}</td> 
 
  </tr>
 
   @endforeach

6th October, 2017

gaan10 left a reply on I Am Trying To Pass 2 Different Columns From My Sql Table To My View ,so That I Can Show Them. My Controller Is • 2 months ago

yes i have the column name in users table. Thanks

gaan10 left a reply on I Am Trying To Pass 2 Different Columns From My Sql Table To My View ,so That I Can Show Them. My Controller Is • 2 months ago

My controller now: $interface = DB::table("users")->distinct()->get(['name']); $inter = DB::table("users")->distinct()->get(['email']); $users = User::all();

view()->share('users',compact('interface','inter','users'));

My view now: @foreach ($users as $key => $value) {{ $value->name }} {{ $value->email }}

Still getting error Undefined property $name

gaan10 left a reply on I Am Trying To Pass 2 Different Columns From My Sql Table To My View ,so That I Can Show Them. My Controller Is • 2 months ago

actually distinct was just an example .there will be others.actually i want to pass multiple sql queries.I am not sure how to do that

gaan10 left a reply on I Am Trying To Pass 2 Different Columns From My Sql Table To My View ,so That I Can Show Them. My Controller Is • 2 months ago

I have to pass multiple queries,cause different data are needed.How to do that.The answer u provided will anyway work but won't fit my question.

gaan10 started a new conversation I Am Trying To Pass 2 Different Columns From My Sql Table To My View ,so That I Can Show Them. My Controller Is • 2 months ago

I am trying to pass 2 different columns from my sql table to my view ,so that i can show them. My controller is:

$interface = DB::table("users")->distinct()->get(['name']);
$interfac = DB::table("users")->distinct()->get(['email']);
        
        view()->share('users',compact('interface','interfac'));

My view is :

@foreach ($users as $key => $value)
<tr>
        <td>{{ $value->name }}</td>
        <td>{{ $value->email }}</td>
 </tr>

But this is not working while passing the two variables.If i pass one it is working but passing two is not working.thanks.

28th September, 2017

gaan10 started a new conversation Trying To Download A Pdf From My Html View Shows Variable Not Found. Using Laravel 5.3 • 2 months ago

I am creating a pdf for download from my html view.Html view is ok but when i try to download it Undefined variable: homedata. My controller is:

$homedata = $this->homevalues(); view()->share('homevalues',$homedata);

    if($request->has('download')){
        $pdf = PDF::loadView('reports');
        return $pdf->download('reports');
    }
    return view('reports',compact('homedata'));

17th December, 2016

gaan10 started a new conversation How To Validate Ip And Netmask Combination In Laravel 5 • 11 months ago

presently i have only simple ip validation .using something like this public function rules() { return [ // 'client_address_start' => 'required|ip', 'client_address_netmask' => 'required|ip', ]; }

do i need a custom rules .if yes how to do that

16th December, 2016

gaan10 left a reply on Unable To Provide Validation In Laravel5.3 • 11 months ago

THnaks much

gaan10 started a new conversation Unable To Provide Validation In Laravel5.3 • 11 months ago

I want to implement validation in my form request. For this i created a request class PostRequest.:

class PostRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return false; }

/**
 * Get the validation rules that apply to the request.
 *
 * @return array
 */
public function rules()
{
    return [
        //
     'client_address_start' => 'required|unique:posts|max:255',
    'admin_email' => 'required|email'
    ];
}

}

I have changed my store method in the controller also public function store(PostRequest $request)

This is my view file input field:

Admin Email
                        <div class="col-md-6">
                            <input id="admin_email" type="ip" class="form-control" name="admin_email" value="{{ $data->admin_email }}" required>
                             @if ($errors->has('admin_email'))
                                <span class="help-block">
                                    <strong>{{ $errors->get('admin_email') }}</strong>
                                </span>
                            @endif

                          
                        </div>
                    </div>           

But when i am posting the form its showing: ReflectionException in Route.php line 339: Class App\Http\Controllers\PostRequest does not exist. I am not sure if my validation is ok

12th December, 2016

gaan10 left a reply on How To Use Another Tables Field In Laravel • 1 year ago

sorry,i didn't understand

gaan10 started a new conversation How To Use Another Tables Field In Laravel • 1 year ago

I have the following view:

@extends('layouts.app')

@section('content')

    
                <div class="panel-heading">subnet_behind_clients1</div>
                <div class="panel-body">
            
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/subnet_behind_clients') }}">
                        {{ csrf_field() }}
                        
                        <div class="form-group{{ $errors->has('client_id') ? ' has-error' : '' }}">
                            <label for="client_id" class="col-md-4 control-label">client_id</label>

                            <div class="col-md-6">
                                <input id="client_id" type="client_id" class="form-control" name="client_id" value="1"  disabled >
                                 </div>
                        </div>


                        <div class="form-group{{ $errors->has('ip_address') ? ' has-error' : '' }}">
                            <label for="ip_address" class="col-md-4 control-label">ip_address</label>

                            <div class="col-md-6">
                                <input id="ip_address" type="ip_address" class="form-control" name="ip_address" required>

                            </div>
                        </div>


                        <div class="form-group{{ $errors->has('netmask') ? ' has-error' : '' }}">
                            <label for="netmask" class="col-md-4 control-label">netmask</label>

                            <div class="col-md-6">
                                <input id="netmask" type="netmask" class="form-control" name="netmask" required>

                                
                            </div>
                        </div>


                 
                        <div class="form-group">
                            <div class="col-md-8 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Apply
                                </button>

                            </div>
                        </div>
                 

                    </form>
                </div>
            
@endsection

Now i want to have a dropdown for the client_id that will take the values client_id from another table (clients) other than the one we are using rightnow. How to achieve that

6th December, 2016

gaan10 left a reply on I Am Not Able To Send My Form Data To The Database. • 1 year ago

yes i created the store method:

public function store(Request $request) {

     $data = Subnet_behind_client::first();
     

    $data->client_id = $request->client_id;
    $data->ip_address = $request->ip_address;


  $data->save();
    return back();

}

gaan10 started a new conversation I Am Not Able To Send My Form Data To The Database. • 1 year ago

THis is my create method in the controller:

public function create(Request $request) { $data = new Subnet_behind_client;

    return view('subnet_behind_clients1',compact('data'));


}

My form:

{{ csrf_field() }}
                    <div class="form-group{{ $errors->has('client_id') ? ' has-error' : '' }}">
                        <label for="client_id" class="col-md-4 control-label">client_id</label>

                        <div class="col-md-6">
                            <input id="client_id" type="client_id" class="form-control" name="client_id" required >

                            
                        </div>

                    </div>

                    <div class="form-group{{ $errors->has('ip_address') ? ' has-error' : '' }}">
                        <label for="ip_address" class="col-md-4 control-label">ip_address</label>

                        <div class="col-md-6">
                            <input id="ip_address" type="ip_address" class="form-control" name="ip_address" required>

                        </div>
                    </div>
Apply
                        </div>
                    </div>

My route file:

Route::get('/subnet_behind_clients1', '[email protected]')->middleware('auth');

Plz let me know where i am going wrong. Thanks

5th December, 2016

gaan10 left a reply on Not Able To Retrieve All Records From The Table • 1 year ago

should i put your create method inside public function create() in the controller?

gaan10 left a reply on Not Able To Retrieve All Records From The Table • 1 year ago

same issue.....when i send the data it overrites the earlier one and shows the result. I want to save multiple data and retrieve all

gaan10 started a new conversation Not Able To Retrieve All Records From The Table • 1 year ago

THis is my controller code for store function.But this is not working.What is the problem here:

public function store(Request $request) { //

     $data = Subnet_behind_client::all();

    $data->client_id = $request->client_id;
    $data->ip_address = $request->ip_address;
    $data->netmask = $request->netmask;
  //  $data->clients = $request->clients;

/* $data->created_at = new DateTime; $data->updated_at = new DateTime;*/

    $data->save();
    return back();

}
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.