jhansi

Experience

4,700

0 Best Reply Awards

  • Member Since 4 Months Ago
  • 18 Lessons Completed
  • 0 Favorites

24th March, 2017

jhansi left a reply on How To Solve CURL Error • 3 days ago

I am using windows 8.1 .my code is as follows: registercontroller.php

<?php

namespace App\Http\Controllers\Auth;
use Illuminate\Support\Facades\Auth;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Http\Request;
use App\Team;
use App\Vendor;

class RegisterController extends Controller
{
   

    use RegistersUsers;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'Team'=>'max:20',
            'Vendor'=>'max:40',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
             'Team' => $data['Team'],
              'Vendor' => $data['Vendor'],
            'password' => bcrypt($data['password']),
        ]);
    }
    
    public function siteRegister()
    {
        return view('register');
    }
    public function siteRegisterPost(Request $request)
    {
      // echo '<pre>################';
       // print_r($request->all());
 $this->validate($request, [
            'name' => 'required',
            'email' => 'required|email',
            'password' => 'required|same:password_confirmation',
            'password_confirmation' => 'required',
            'g-recaptcha-response' => 'required|captcha',
        ]);
        // Auth::login($user);
        return Redirect::to('home');
       // print('done');
        // $selectData = $request->input('Team');
        //  $selectData = $request->input('Vendor');


    }

 public function showregistrationform()
{
   
     $teams = Team::all(['Team_id','Team']);
  
     $vendors = Vendor::all(['Vendor_id','Vendor']);
    //echo '<pre>'.print_r($teams,true).'</pre>';

     
    return view('auth.register', [ 'teams' =>$teams,'vendors' => $vendors]);
}

}

register.blade.php


@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Register</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/site-register') }}">
                        {{ csrf_field() }}

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

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

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

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Team" class="form control">
                  
                  @foreach($teams as $team)
            <option value="{{ $team->Team_id }}" <?php echo ($team->Team_id==2)? 'selected':'';?> >{{ $team->Team }}</option>    
@endforeach
                               
                                 


                            </select>
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                         <div class="form-group{{ $errors->has('Vendor') ? ' has-error' : '' }}">
                        
                            <label for="Vendor" class="col-md-4 control-label">Vendor</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Vendor" class="form control">
                             @foreach($vendors as $vendor)
            <option value="{{ $vendor->Vendor_id }}" <?php echo ($vendor->Vendor_id==2)? 'selected':'';?> >{{ $vendor->Vendor }}</option>    
@endforeach
                    

                            </select>
                                @if ($errors->has('Vendor'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Vendor') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>


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

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

                                @if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>
                        <div class="form-group">

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

                            <div class="col-md-6">
                             

                                @if ($errors->has('g-recaptcha-response'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Register
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

web.php

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();
Route::get('/user',[email protected]');
//Route::group(['middleware' => 'authenticated'], function(){
    //user routes

Route::get('/home', [email protected]');


Route::get('site-register', 'Auth\[email protected]');
Route::post('site-register', 'Auth\[email protected]');


//task routes
Route::get('/regtime/add', function () {
    return view('regtime');
});

Route::get('/regtime/listing', [email protected]');

Route::post('/regtime/add', [email protected]');
Route::get('/regtime/delete{timesheet_id}',[email protected]');
Route::get('/regtime/edit{timesheet_id}',[email protected]');
Route::get('/timesheetedit/{timesheet_id}', [email protected]');
Route::post('/timesheeteditt/{timesheet_id}', [email protected]');
//import/export routes

Route::get('importExport', [email protected]');
Route::get('downloadExcel/{type}', [email protected]');
Route::post('importExcel', [email protected]');

Route::get('/reg', [email protected]');
Route::post('/reg', [email protected]');
//Team routes

Route::get('/teams/add', function () {
    return view('team');
});
Route::get('/teams/listing', [email protected]');

Route::post('/insert', [email protected]');
//vendor routes

Route::get('/vendors/add', function () {
    return view('vendor');
});

Route::get('/vendors/listing', [email protected]');

Route::post('/increment', [email protected]');

//});

}

22nd March, 2017

jhansi left a reply on How To Solve CURL Error • 4 days ago

@bobbybouwmann still getting the same error after restarting the xampp server

jhansi started a new conversation How To Solve CURL Error • 5 days ago

cURL error 28: Resolving timed out after 2625 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

17th March, 2017

jhansi left a reply on Illegal String Offset 'name'.how To Solve This Error Can Anyone Please Tell Me • 1 week ago

@SaeedPrez please explain me via example so that i can understand it clearly

jhansi left a reply on Illegal String Offset 'name'.how To Solve This Error Can Anyone Please Tell Me • 1 week ago

No it was not solved.same error occuring

jhansi left a reply on Illegal String Offset 'name'.how To Solve This Error Can Anyone Please Tell Me • 1 week ago

Yes,but it is the way to insert data (import) to my users table

jhansi started a new conversation Illegal String Offset 'name'.how To Solve This Error Can Anyone Please Tell Me • 1 week ago

http://www.awesomescreenshot.com/showImage?img_id=2303478 You can see error by going to above url. Democontroller.php

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\User;
use Excel;

class DemoController extends Controller
{
    public function importExport()
    {
        return view('importExport');
    }
    public function downloadExcel(Request $request, $type)
    {
        $data = User::get()->toArray();
        return Excel::create('users', function($excel) use ($data) {
            $excel->sheet('mySheet', function($sheet) use ($data)
            {
                $sheet->fromArray($data);
            });
        })->download($type);
    }

    /**
     * Import file into database Code
     *
     * @var array
     */
    public function importExcel(Request $request)
    {

        if($request->hasFile('import_file')){
            $path = $request->file('import_file')->getRealPath();

            $data = Excel::load($path, function($reader) {})->get();

            if(!empty($data) && $data->count()){

                foreach ($data->toArray() as $key => $value) {
                    if(!empty($value)){
                        foreach ($value as $v) {        
                            $insert[] = ['name' => $v['name'], 'email' => $v['email'],'Team' => $v['Team'],'Vendor' => $v['Vendor'],'password'=>$v['password'];
                        }
                    }
                }

                
                if(!empty($insert)){
                    User::insert($insert);
                    return back()->with('success','Insert Record successfully.');
                }

            }

        }

        return back()->with('error','Please Check your file, Something is wrong there.');
    }

}

web.php

ute::get('importExport', [email protected]');
Route::get('downloadExcel/{type}', [email protected]');
Route::post('importExcel', [email protected]');

importExport.blade.php

<html lang="en">
<head>
    <title>Import - Export Laravel 5.3</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" >
</head>

<body>
<br/>
<br/>
    <div class="container">     
        <div class="panel panel-primary">
          <div class="panel-heading">
            <h3 class="panel-title" style="padding:12px 0px;font-size:25px;"><strong>Laravel 5.3 - import export csv or excel file into database example</strong></h3>
          </div>
          <div class="panel-body">

                @if ($message = Session::get('success'))
                    <div class="alert alert-success" role="alert">
                        {{ Session::get('success') }}
                    </div>
                @endif

                @if ($message = Session::get('error'))
                    <div class="alert alert-danger" role="alert">
                        {{ Session::get('error') }}
                    </div>
                @endif

                <h3>Import File Form:</h3>
                <form style="border: 4px solid #a1a1a1;margin-top: 15px;padding: 20px;" action="{{ URL::to('importExcel') }}" class="form-horizontal" method="post" enctype="multipart/form-data">

                    <input type="file" name="import_file" />
                    {{ csrf_field() }}
                    <br/>

                    <button class="btn btn-primary">Import CSV or Excel File</button>

                </form>
                <br/>

                
                <h3>Import File From Database:</h3>
                <div style="border: 4px solid #a1a1a1;margin-top: 15px;padding: 20px;">         
                    <a href="{{ url('downloadExcel/xls') }}"><button class="btn btn-success btn-lg">Download Excel xls</button></a>
                    <a href="{{ url('downloadExcel/xlsx') }}"><button class="btn btn-success btn-lg">Download Excel xlsx</button></a>
                    <a href="{{ url('downloadExcel/csv') }}"><button class="btn btn-success btn-lg">Download CSV</button></a>
                </div>

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

</body>

</html>

16th March, 2017

jhansi left a reply on My Page Is Registering Without Google Recaptcha .How To Validate It Can Anyone Please Tell Me? • 1 week ago

By using xampp server in local browser .My problem is without taking any google recaptcha my page is going to login page.can you please help me regarding that?

jhansi left a reply on My Page Is Registering Without Google Recaptcha .How To Validate It Can Anyone Please Tell Me? • 1 week ago

register.blade.php


@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Register</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
                        {{ csrf_field() }}

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

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

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

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Team" class="form control">
                  
                  @foreach($teams as $team)
            <option value="{{ $team->Team }}" <?php echo ($team->Team_id==2)? 'selected':'';?>>{{ $team->Team }}</option>  
            
                 @endforeach
                               
                                 


                            </select>
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                         <div class="form-group{{ $errors->has('Vendor') ? ' has-error' : '' }}">
                        
                            <label for="Vendor" class="col-md-4 control-label">Vendor</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Vendor" class="form control">
                             @foreach($vendors as $vendor)
            <option value="{{ $vendor->Vendor }}" <?php echo ($vendor->Vendor_id==2)? 'selected':'';?> >{{ $vendor->Vendor }}</option>    
@endforeach
                    

                            </select>
                                @if ($errors->has('Vendor'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Vendor') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>


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

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

                                @if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
                            <label class="col-md-4 control-label">Captcha</label>

                            <div class="col-md-6">
                                {!! app('captcha')->display() !!}

                                @if ($errors->has('g-recaptcha-response'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Register
                                </button>
                            </div>
                        </div>
                    </form>
                    <script src="https://www.google.com/reCAPTCHA/api.js">
    </script>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Register</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
                        {{ csrf_field() }}

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

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

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

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Team" class="form control">
                  
                  @foreach($teams as $team)
            <option value="{{ $team->Team }}" <?php echo ($team->Team_id==2)? 'selected':'';?>>{{ $team->Team }}</option>  
            
                 @endforeach
                               
                                 


                            </select>
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                         <div class="form-group{{ $errors->has('Vendor') ? ' has-error' : '' }}">
                        
                            <label for="Vendor" class="col-md-4 control-label">Vendor</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Vendor" class="form control">
                             @foreach($vendors as $vendor)
            <option value="{{ $vendor->Vendor }}" <?php echo ($vendor->Vendor_id==2)? 'selected':'';?> >{{ $vendor->Vendor }}</option>    
@endforeach
                    

                            </select>
                                @if ($errors->has('Vendor'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Vendor') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>


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

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

                                @if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
                            <label class="col-md-4 control-label">Captcha</label>

                            <div class="col-md-6">
                                {!! app('captcha')->display() !!}

                                @if ($errors->has('g-recaptcha-response'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Register
                                </button>
                            </div>
                        </div>
                    </form>
                    <script src="https://www.google.com/reCAPTCHA/api.js">
    </script>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

registercontroller.php

<?php

namespace App\Http\Controllers\Auth;
use Illuminate\Support\Facades\Auth;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;
use App\Team;
use App\Vendor;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'Team'=>'max:20',
            'Vendor'=>'max:40',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
             'Team' => $data['Team'],
              'Vendor' => $data['Vendor'],
            'password' => bcrypt($data['password']),
        ]);
    }
    public function siteRegister()
    {
        return view('siteRegister');
    }

    public function siteRegisterPost(Request $request)
    {
        $this->validate($request, [
            'name' => 'required',
            'email' => 'required|email',
            'password' => 'required|same:password_confirmation',
            'password_confirmation' => 'required',
            'g-recaptcha-response' => 'required|captcha',
        ]);
        print('done');
         $selectData = $request->input('Team');
          $selectData = $request->input('Vendor');


    }
 public function showregistrationform()
{
   
     $teams = Team::all(['Team_id','Team']);
  
     $vendors = Vendor::all(['Vendor_id','Vendor']);
    //echo '<pre>'.print_r($teams,true).'</pre>';

     
    return view('auth.register', [ 'teams' =>$teams,'vendors' => $vendors]);
}

}

web.php

    return view('welcome');
});

Auth::routes();

Route::get('/home', [email protected]');
Route::get('site-register', 'Auth\[email protected]');
Route::post('site-register', 'Auth\[email protected]');
Route::get('/user',[email protected]');



Route::get('/Team', function () {
    return view('team');
});
Route::get('/teams', [email protected]');

Route::post('/insert', [email protected]');

Route::get('/Vendor', function () {
    return view('vendor');
});

Route::get('/vendors', [email protected]');

Route::post('/increment', [email protected]');

jhansi started a new conversation My Page Is Registering Without Google Recaptcha .How To Validate It Can Anyone Please Tell Me? • 1 week ago

Please upgrade to a supported browser to get a reCAPTCHA challenge.

Alternatively if you think you are getting this page in error, please check your internet connection and reload.

Why is this happening to me?

This is appearing on the page.By using this site I used google reCaptcha http://itsolutionstuff.com/post/laravel-5-google-recaptcha-code-and-validation-example-using-anhskohbo-no-captcha-packageexample.html

6th March, 2017

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 2 weeks ago

@Yama Can you please just tell me an example so that I can it clearly

5th March, 2017

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

Can anyone tell me how to get the selected value from team table to users table using id,Team_id,name?

3rd March, 2017

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

I wrote the code as follows but it is still giving the same error as null

<select name="Admin">
<option value="">Select Team</option>

<option value="Admin  @if(old('Admin',$teams->Team_id) == "Admin") selected @endif >Admin</option>

<option value="Developer"  @if(old('Admin',$teams->Team_id) == "Developer") selected @endif >Developer</option>
</select>

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

@christianus But i need to get the values from the table team instead of writing it manually.

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

it is giving null value

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

This my change in register.blade.php

<select class="form-control" name="Team_id">

    @if ($Teams->count())

        @foreach($Teams as $Team)
            <option value="{{ $Team->id }}" {{ $selectedTeam== $Team->id ? 'selected="selected"' : '' }}>{{ $Team->name }}</option>    
@endforeach
    @endif

</select>

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

Then it is giving error as:

Undefined variable: Teams (View: C:\xampp\htdocs\list\resources\views\auth\register.blade.php)

2nd March, 2017

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

@cviv In controller i used it

public function index()
{
    $Teams = Team::all();
    $selectedTeam = User::first()->Team_id;

    return view('auth.register', compact('Teams', 'selectedTeam');
}

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

@cviv It is giving syntax error, unexpected '='

<select class="form-control" name="Team_id">

    @if ($Teams->count())

        @foreach($Teams as $Team)
            <option value="{{ $Team->id }}" {{ $selectedTeam== $Team->id ? 'selected="selected"' : '' }}>{{ $Team->name }}</option>    

    @endif

</select>

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

Like this I replaced still getting the error as $Team not found:undefined variable

<select class="form-control" name="Team_id">
    <option selected value="{{$Team->Team_id}}">
        <b>{{$Team->users['Team']}}</b>
    </option>
    @foreach($Teams as $Team)
    <?php $dd = $Team->users['Team'];
    $cc = $b->Team; ?>
        @if($dd == $cc )
        <option style="display: none;" value="{{$b->id}}">{{$b->Team}}</option>
        @else
        <option value="{{$b->id}}">{{$b->Team}}</option>
        @endif
    @endforeach
</select>

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

I did not understand can you please explain Elaborately

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

Can anyone tell me how to select team value which was a drop down in users table from other table team by using their id's:id,Team_id.

jhansi left a reply on Select DropDown Option Seleted In Laravel • 3 weeks ago

@snapey I started new discussion like this"Please tell me How to Select DropDown Option Selected In Laravel" but I have found no solution,So i came back for solution.

1st March, 2017

jhansi left a reply on Select DropDown Option Seleted In Laravel • 3 weeks ago

@bobbybouwmann can you please tell me the fixed answer so that I can solve the issue

jhansi left a reply on Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

@tisuchi ```

``` This was in team.blade.php not in register.blade.php.Then what i has to change

jhansi started a new conversation Please Tell Me How To Select DropDown Option Selected In Laravel • 3 weeks ago

@bobbybouwmann this my first table users.table

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
             $table->string('Team');
              $table->string('Vendor');
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}

Teamstable(migration)

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTeamsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('teams', function (Blueprint $table) {
            $table->increments('Team_id');
            $table->string('Team');
            $table->date('Date');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('teams');
    }
}

Register.blade.php

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Register</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
                        {{ csrf_field() }}

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

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

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

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Team" class="form control">
                  
                                 <option value="">Select Team</option>
                                 <option value="Admin">Admin</option>
                                 <option value="Developer">Developer</option>
                                 <option value="Tester">Tester</option>
                                 


                            </select>
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                       

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

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

                                @if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
                            <label class="col-md-4 control-label">Captcha</label>

                            <div class="col-md-6">
                                {!! app('captcha')->display() !!}

                                @if ($errors->has('g-recaptcha-response'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Register
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

Registercontroller.php

<?php

namespace App\Http\Controllers\Auth;
use Illuminate\Support\Facades\Auth;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;
use App\Team;
use App\Vendor;

class RegisterController extends Controller
{
    

    use RegistersUsers;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'Team'=>'max:20',
            'Vendor'=>'max:40',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
             'Team' => $data['Team'],
              'Vendor' => $data['Vendor'],
            'password' => bcrypt($data['password']),
        ]);
    }
    public function siteRegister()
    {
        return view('siteRegister');
    }

    public function siteRegisterPost(Request $request)
    {
        $this->validate($request, [
            'name' => 'required',
            'email' => 'required|email',
            'password' => 'required|same:password_confirmation',
            'password_confirmation' => 'required',
            'g-recaptcha-response' => 'required|captcha',
        ]);
        print('done');
    }
 public function showregistrationform()
{
   //this depends on your model 
    $teams = Team::all(); // Get all teams
    $vendors = Vendor::all();//Get all vendors
   
    return view('auth.register', [ 'Teams' => $teams,'Vendors' => $vendors]);
}
}

team.blade.php

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Textbox1</div>
                <div class="panel-body">

                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/insert') }}">
                        {{ csrf_field() }}
                        

                    <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team Name</label>
                            
                     
                            <div class="col-md-6">
                             <input id="Team" type="text" class="form-control" name="Team" value="{{ old('Team') }}" required>
                            
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Date') ? ' has-error' : '' }}">
                            <label for="Date" class="col-md-4 control-label">Date</label>

                            <div class="col-md-6">
                                <input id="Date" type="Date" class="form-control" name="Date" value="{{ old('Date') }}" required autofocus>

                                @if ($errors->has('Date'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Date') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                              <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                    Submit
                                </button>
                            </div>
                        </div>
                   </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

TeamController.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Team;
use Illuminate\Support\Facades\Redirect;

use Illuminate\Support\Facades\Input;

class TeamsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function intro()
    {
        $teams = Team::paginate(10); // To use $teams->links(), you need paginate();
        return  view('intro')->with('teams', $teams);
    }
     public function hire()
    {
        echo "Your Table is as follows:";
         $team = new Team;

    $team->Team = Input::get('Team');
    $team->Date = Input::get('Date');
   
    $team->save();
        return Redirect::to('teams');


    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return View::make('team');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        DB::table('teams')->insert($request->all());

    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}

intro.blade.php

@extends('layouts.app')

@section('content')

    <table  class="table table-bordered user" >    

        <tr>
            <th>Team_id</th>
            <th>Team Name</th>
            <th>Date</th>
        </tr>

        @foreach ($teams as $team)
            <tr>
                <td>{{ $team->Team_id }}</td>
                <td>{{ $team->Team }}</td>
                <td>{{ $team->Date }}</td>
            </tr>
        @endforeach
    </table>
    <div class="text-center">
        {{ $teams->links() }}
    </div>

@endsection

web.php

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', [email protected]');
Route::get('site-register', 'Auth\[email protected]');
Route::post('site-register', 'Auth\[email protected]');
Route::get('/Team', function () {
    return view('team');
});
Route::get('/teams', [email protected]');

Route::post('/insert', [email protected]');

28th February, 2017

jhansi started a new conversation Please Tell Me How To Change Id To Team_id To Already Created Migration Table • 3 weeks ago

My migration table

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTeamsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('teams', function (Blueprint $table) {
            $table->increments('id');
            $table->string('Team');
            $table->date('Date');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('teams');
    }
}

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 3 weeks ago

@sagar.jagtap Please help in steps wise how to retrieve the team and vendor values from their tables to users table.

27th February, 2017

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

@cviv please help me by stating an example for retrieving values from team and vendor tables to users table by using id.

23rd February, 2017

jhansi left a reply on Where Are You All From? • 1 month ago

I am from india

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

Can you please give me a example so that I can understand it clearly to retrieve the team from team table to users registration table by using id.

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

@cviv I just need to use id from team and vendor tables to keep the values in the users table so that team and vendor get selected by using id.Can you tell me how to do it

22nd February, 2017

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

@cviv It is working but I can't find the reason why it is not retrieving the values in users table

Collection {#280 ▼
  #items: array:12 [▼
    0 => Team {#281 ▶}
    1 => Team {#282 ▼
      #fillable: array:3 [▼
        0 => "id"
        1 => "Team Name"
        2 => "Date"
      ]
      #connection: null
      #table: null
      #primaryKey: "id"
      #keyType: "int"
      #perPage: 15
      +incrementing: true
      +timestamps: true
      #attributes: array:5 [▼
        "id" => 2
        "Team" => "Admin net"
        "Date" => "2017-02-16"
        "created_at" => "2017-02-15 05:49:56"
        "updated_at" => "2017-02-15 05:49:56"
      ]
      #original: array:5 [▶]
      #relations: []
      #hidden: []
      #visible: []
      #appends: []
      #guarded: array:1 [▶]
      #dates: []
      #dateFormat: null
      #casts: []
      #touches: []
      #observables: []
      #with: []
      +exists: true
      +wasRecentlyCreated: false
    }
    2 => Team {#283 ▶}
    3 => Team {#284 ▶}
    4 => Team {#285 ▶}
    5 => Team {#286 ▶}
    6 => Team {#287 ▶}
    7 => Team {#288 ▶}
    8 => Team {#289 ▶}
    9 => Team {#290 ▶}
    10 => Team {#291 ▶}
    11 => Team {#292 ▶}
  ]
}

21st February, 2017

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

@cviv I solved the issue but it is not retrieving values from team and vendors tables.what to do?

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

Yes i added in registercontroller.php

use App\Team;
use App\Vendor;

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

I have vendors model .View is not in the auth folder.

20th February, 2017

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

@cviv after writing the code I am getting the error FatalErrorException in RegisterController.php line 98: Class 'App\Http\Controllers\Auth\Vendors' not found in RegisterController.php line 98

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

@cviv I just want to get the values from tables team and vendor to user registration table( dropdown valu.es must be taken from the team and vendor table with the help of id)

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

vendorcontroller.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Vendor;
use Illuminate\Support\Facades\Redirect;

use Illuminate\Support\Facades\Input;

class VendorsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function indro()
    {
        $vendors = Vendor::paginate(10); // To use $vendors->links(), you need paginate();
        return  view('indro')->with('vendors', $vendors);
    }

  
    public function hike()
    {
       echo "Your Table is as follows:";
         $vendor = new Vendor;

    $vendor->Vendor = Input::get('Vendor');
    $vendor->Date = Input::get('Date');
    $vendor->save();
        return Redirect::to('vendors');
    }
      /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
      public function create()
    {
        return View::make('vendor');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
          DB::table('vendors')->insert($request->all());
    }

Teamcontroller.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Team;
use Illuminate\Support\Facades\Redirect;

use Illuminate\Support\Facades\Input;

class TeamsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function intro()
    {
        $teams = Team::paginate(10); // To use $teams->links(), you need paginate();
        return  view('intro')->with('teams', $teams);
    }
     public function hire()
    {
        echo "Your Table is as follows:";
         $team = new Team;

    $team->Team = Input::get('Team');
    $team->Date = Input::get('Date');
   
    $team->save();
        return Redirect::to('teams');


    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return View::make('team');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        DB::table('teams')->insert($request->all());

    }
 /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}

registercontroller.php

<?php

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'Team'=>'max:20',
            'Vendor'=>'max:40',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
             'Team' => $data['Team'],
              'Vendor' => $data['Vendor'],
            'password' => bcrypt($data['password']),
        ]);
    }
    public function siteRegister()
    {
        return view('siteRegister');
    }

    public function siteRegisterPost(Request $request)
    {
        $this->validate($request, [
            'name' => 'required',
            'email' => 'required|email',
            'password' => 'required|same:password_confirmation',
            'password_confirmation' => 'required',
            'g-recaptcha-response' => 'required|captcha',
        ]);
        print('done');
    }
    public function showregistrationform()
{
    $Teams = User::all(); // get all teams
    return view('auth.register', [ 'Teams' => $Teams]);

}
public function showregistrationform1()
{
    $Vendors = User::all(); // get all teams
    return view('auth.register', [ 'Vendors' => $Vendors]);

}

}

jhansi left a reply on How To Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

Vendor.blade.php

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Textbox2</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/increment') }}">
                        {{ csrf_field() }}
                    <div class="form-group{{ $errors->has('Vendor') ? ' has-error' : '' }}">
                        
                            <label for="Vendor" class="col-md-4 control-label">Vendor Name</label>
                            
                     
                            <div class="col-md-6">
                             <input id="Vendor" type="text" class="form-control" name="Vendor" value="{{ old('Vendor') }}" required>
                            
                                @if ($errors->has('Vendor'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Vendor') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Date') ? ' has-error' : '' }}">
                            <label for="Date" class="col-md-4 control-label">Date</label>

                            <div class="col-md-6">
                                <input id="Date" type="Date" class="form-control" name="Date" value="{{ old('Date') }}" required autofocus>

                                @if ($errors->has('Date'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Date') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                              <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                    Submit
                                </button>
                            </div>
                        </div>
                   </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

Team.blade.php

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Textbox1</div>
                <div class="panel-body">

                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/insert') }}">
                        {{ csrf_field() }}
                        

                    <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team Name</label>
                            
                     
                            <div class="col-md-6">
                             <input id="Team" type="text" class="form-control" name="Team" value="{{ old('Team') }}" required>
                            
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Date') ? ' has-error' : '' }}">
                            <label for="Date" class="col-md-4 control-label">Date</label>

                            <div class="col-md-6">
                                <input id="Date" type="Date" class="form-control" name="Date" value="{{ old('Date') }}" required autofocus>

                                @if ($errors->has('Date'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Date') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                              <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                            <button type="submit" class="btn btn-primary">
                                    Submit
                                </button>
                            </div>
                        </div>
                   </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

register.blade.php

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">Register</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
                        {{ csrf_field() }}

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

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" name="name" value="{{ old('name') }}" required autofocus>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

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

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('Team') ? ' has-error' : '' }}">
                        
                            <label for="Team" class="col-md-4 control-label">Team</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Team" class="form control">
                  
                                 <option value="">Select Team</option>
                                 <option value="Admin">Admin</option>
                                 <option value="Developer">Developer</option>
                                 <option value="Tester">Tester</option>
                                 

                            </select>
                                @if ($errors->has('Team'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Team') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
                         <div class="form-group{{ $errors->has('Vendor') ? ' has-error' : '' }}">
                        
                            <label for="Vendor" class="col-md-4 control-label">Vendor</label>
                            
                            
                            <div class="col-md-6">
                            <select name="Vendor" class="form control">
                  
                                 <option value="">Select Vendor</option>
                                 <option value="MicrosoftSQLServer">MicrosoftSQLServer</option>
                                 <option value="Mysql">Mysql</option>
                                 <option value="IBMDB2">IBMDB2</option>
                                 

                            </select>
                                @if ($errors->has('Vendor'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('Vendor') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>


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

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

                                @if ($errors->has('password'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('g-recaptcha-response') ? ' has-error' : '' }}">
                            <label class="col-md-4 control-label">Captcha</label>

                            <div class="col-md-6">
                                {!! app('captcha')->display() !!}

                                @if ($errors->has('g-recaptcha-response'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Register
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

19th February, 2017

jhansi started a new conversation Retrieve Values From 2 Different Tables And Put Them In A Drop Menus Of Other Table With Laravel. • 1 month ago

Please explain me in detail steps to do it.

Team table contains the fields like id,Team(name),date. Vendor table contains the fields like id,Vendor(name),date. Users table contains the fields like name,
email,team,vendor, password ,confirm password .
 Now i want to take the values from the tables of team and vendor to users registration page. in users table team and vendor are drop down list.
Team has drop down menu with values:Developer,Tester,Designer,Admin.
Vendors has drop down menu with values:Microsoft SQL Server,IBM DB2,MariaDB Enterprise,MySQL

15th February, 2017

jhansi started a new conversation Can Any Please Tell Me How We Can Fetch The Values From 2 Tables Namely Team And Vendor Of A Database To Users Table. • 1 month ago

Team table contains the fields like id,Team(name),date. Vendor table contains the fields like id,Vendor(name),date. Users table contains the fields like name,email,team,vendor, password ,confirm password . Now i want to take the values from the tables of team and vendor to users registration page. in users table team and vendor are drop down list.

jhansi started a new conversation Can Anyone Tell How To Fetch Values From Team And Vendor Table To A Users Table With The Dropdown Menus Of Team And Vendor • 1 month ago

each dropdowns, you have to dynamically pull records from their respective tables (vendor, team)the values fetching from the tables id, name, and date_added for both tables:tam and vendors usertable contain fields like name,email,team,vendor and password fields.

jhansi left a reply on MethodNotAllowedHttpException In RouteCollection.php Line 218: • 1 month ago

I solved the issue by just adding web.php as follows:

Route::get('/Team', function () {
    return view('team');
});
Route::get('/teams', [email protected]');

Route::post('/insert', [email protected]');

TeamController.php

 public function hire()
    {
        echo "Your Table is as follows:";
         $team = new Team;

    $team->Team = Input::get('Team');
    $team->Date = Input::get('Date');
   
    $team->save();
        return Redirect::to('teams');
    }

team.blade.php

<form class="form-horizontal" role="form" method="POST" action="{{ url('/insert') }}">

14th February, 2017

jhansi left a reply on MethodNotAllowedHttpException In RouteCollection.php Line 218: • 1 month ago

@Mittensoff still getting the same error

Edit Your Profile
Update

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