/**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $faults = Attendfault::where('attended', '=', 'No')->get();
     $months = Month::all();
     $states = State::all();
     View::share(['counts' => $faults, 'states' => $states, 'months' => $months]);
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $cats = Cat::all();
     $bizs = Biz::all();
     $states = State::all();
     return view('admin.index', compact('biz', 'states', 'featured'))->withCats($cats);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $states = State::all();
     $totalState = State::count();
     //  dd($state->name);
     return view('admin.location.index', compact('states', 'totalState'));
 }
Ejemplo n.º 4
0
 public function index(Manager $fractal, StateTransformer $stateTransformer)
 {
     // show all
     $records = State::all();
     $collection = new Collection($records, $stateTransformer);
     $data = $fractal->createData($collection)->toArray();
     return $this->respond($data);
 }
Ejemplo n.º 5
0
 public function locations()
 {
     $states = State::all();
     $totalState = State::count();
     $totalBiz = Biz::count();
     $stateList = State::lists('name', 'name');
     return view('pages.locations', compact('states', 'totalState', 'stateList', 'totalBiz'));
 }
Ejemplo n.º 6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $title = 'CONFIG';
     $country = Country::all()->sortBy('country');
     $designation = Designation::all()->sortBy('designation');
     $city = City::all()->sortBy('city');
     $state = State::all()->sortBy('state');
     $brands = Brands::all()->sortBy('brand');
     $models = Models::all()->sortBy('model');
     $businessType = BusinessType::all()->sortBy('name');
     return view('myConfig.index', compact('title', 'country', 'designation', 'city', 'state', 'brands', 'models', 'businessType'));
 }
Ejemplo n.º 7
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     /*view()->share('categories', Category::all());*/
     view()->composer('layouts.partials.categories', function ($view) {
         $view->with('categories', Category::where('parent_id', 0)->get());
     });
     view()->composer('layouts.partials.states', function ($view) {
         $view->with('states', State::all());
     });
     view()->composer('index', function ($view) {
         $view->with('categories', Category::where('parent_id', 0)->get());
     });
 }
Ejemplo n.º 8
0
 public function testRegisterAction()
 {
     // use the factory to create a Faker\Generator instance
     $faker = Faker\Factory::create();
     // Add pt_BR provider
     $faker->addProvider(new Faker\Provider\pt_BR\Person($faker));
     //Generate a User Data to Register
     $name = $faker->name($gender = null | 'male' | 'female');
     $email = $faker->freeEmail();
     $cpf = $faker->cpf;
     $pwd = '123456';
     $state = State::all()->random();
     $uuid = $faker->uuid;
     // prevent validation error on captcha
     NoCaptcha::shouldReceive('verifyResponse')->once()->andReturn(true);
     // provide hidden input for your 'required' validation
     NoCaptcha::shouldReceive('display')->zeroOrMoreTimes()->andReturn('<input type="hidden" name="g-recaptcha-response" value="1" />');
     $this->visit('/')->click('Registro')->seePageIs('/login')->type($name, 'name')->type($email, 'email')->type($cpf, 'cpf')->type($pwd, 'password')->type($pwd, 'password_confirmation')->select($state->uf, 'uf')->type($uuid, 'uuid')->press('Registro')->see('Registro feito com Sucesso.')->seePageIs('/')->seeInDatabase('users', ['email' => $email]);
 }
Ejemplo n.º 9
0
 /**
  * Display a listing of the City.
  * @return Response
  */
 public function index()
 {
     $states = \App\State::all();
     $cities = $this->cityRepository->paginate(10);
     return view('cities.index', compact('states'))->with('cities', $cities);
 }
Ejemplo n.º 10
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $states = State::all();
     return view('admin.state.index', compact('states'));
 }
Ejemplo n.º 11
0
 /**
  * Display a list of state from storage
  * @return static
  */
 public function state()
 {
     $result = State::all()->lists('state', 'state');
     return $result;
 }
Ejemplo n.º 12
0
      {!! Form::text('firstName', '', ['id'=>'firstName']); !!}
    </label>
    <label for='address'>
      <span>Address</span>
          {!! Form::text('address', '',['id'=>'address']); !!}
      </label>

      <label for='city'>
        <span>City</span>
        {!! Form::text('city','', ['id'=>'city']); !!}
      </label>

      <label for='state'>
        <span>State</span>
      <?php 
$states = \App\State::all();
?>
      <select name="state">
        @foreach($states as $stateEntry)
          <option value= "{{ $stateEntry->state }}"
            @if(isset( $state ))
             @if( $stateEntry->state == $state )
              selected="selected"
             @endif
            @endif
     > {{ $stateEntry->state }}</option>
        @endforeach
      </select>
      </label>

      <label for='zip'>
Ejemplo n.º 13
0
 /**
  *Handle get request to '/analysis'
  *
  * @return \Illuminate\Http\Response
  */
 public function analysis()
 {
     $components = Component::all('component', 'component_id');
     $states = State::all('state', 'state_id');
     return view('analysis', compact('states', 'components'));
 }
Ejemplo n.º 14
0
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| Here you may define all of your model factories. Model factories give
| you a convenient way to create models for testing and seeding your
| database. Just tell the factory how a default model should look.
|
*/
use App\Proposal;
use App\State;
use App\User;
use Illuminate\Support\Facades\Request;
$factory->define(App\User::class, function (Faker\Generator $faker) {
    return ['name' => $faker->name, 'email' => $faker->email, 'password' => Hash::make('123456'), 'remember_token' => str_random(10), 'role_id' => $faker->randomElement([1, 2, 99]), 'uf' => State::all()->shuffle()->first()->uf, 'cpf' => $faker->cpf, 'uuid' => $faker->uuid];
});
$factory->defineAs(App\User::class, 'admin', function (Faker\Generator $faker) use($factory) {
    $user = $factory->raw(App\User::class);
    //Admin 0
    return array_merge($user, ['role_id' => 0]);
});
$factory->define(App\Proposal::class, function (Faker\Generator $faker) {
    $random = $faker->boolean($chanceOfGettingTrue = 20);
    return ['name' => $faker->sentence($nbWords = 6, $variableNbWords = true), 'user_id' => User::all()->shuffle()->first()->id, 'open' => true, 'idea_central' => $faker->text($maxNbChars = 100), 'problem' => $faker->paragraph($nbSentences = 3, $variableNbSentences = true), 'idea_exposition' => $faker->realText($maxNbChars = 200, $indexSize = 2), 'response' => $response = $faker->randomElement($array = [null, $faker->realText($maxNbChars = 100, $indexSize = 2), $faker->text($maxNbChars = 50)]), 'responder_id' => !$response ? null : User::all()->where('role_id', 1)->shuffle()->first()->id, 'disapproved_at' => !$response ? null : \Carbon\Carbon::now(), 'disapproved_by' => !$response ? null : User::all()->where('role_id', 1)->shuffle()->first()->id, 'approved_at' => $response ? null : ($random ? null : \Carbon\Carbon::now()), 'approved_by' => $response ? null : ($random ? null : User::all()->where('role_id', 1)->shuffle()->first()->id), 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now(), 'pub_date' => \Carbon\Carbon::now(), 'limit_date' => \Carbon\Carbon::now()->addMonth(config('global.timeLimitMonth'))];
});
$factory->define(App\Like::class, function (Faker\Generator $faker) {
    $user_id = User::all()->shuffle()->first()->id;
    return ['user_id' => $user_id, 'proposal_id' => Proposal::all()->shuffle()->first()->id, 'uuid' => User::where('id', $user_id)->first()->uuid, 'like' => $faker->boolean($chanceOfGettingTrue = 70), 'ip_address' => Request::ip()];
});
$factory->define(App\ProposalFollow::class, function (Faker\Generator $faker) {