Example #1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $client = Client::findOrFail($id);
     $pid = $client->id;
     $bairro = Bairro::where('id', $client->bairro)->get();
     $pets = Pet::where('owner_id', $pid)->get();
     $numbers = Number::where('clientid', $pid)->get();
     return view('clients.show', compact('client', 'pets', 'bairro', 'numbers'));
 }
Example #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $number = Number::findOrFail($id);
     $number->delete();
     return redirect('clients');
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function editUser($slug)
 {
     //
     $user = User::where('slug', '=', $slug)->first();
     $number = Number::where('user_id', '=', $user->id)->get();
     $mail = Email::where('user_id', '=', $user->id)->get();
     $option[0] = $user;
     $option[1] = $number;
     $option[2] = $mail;
     //dd($option);
     return view('frontend.edit', compact('option'));
 }
/*
 * Your work begins on LINE 249.
 */
describe('Fizz Buzz Problem', function () {
    describe('#convert', function () {
        it('it returns 1 for [1]', function () {
            $sequence = Number::convert([1]);
            expect($sequence)->toBe("1");
        });
        it('it returns 2 for [2]', function () {
            $sequence = Number::convert([1, 2]);
            expect($sequence)->toBe("1, 2");
        });
        it('it returns fizz for [3]', function () {
            $sequence = Number::convert([3]);
            expect($sequence)->toBe("fizz");
        });
        it('it returns 1, 2, fizz, 4, buzz, fizz, 7, 8, fizz, buzz, 11, fizz, 13, 14, fizzbuzz for [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]', function () {
            $sequence = Number::convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
            expect($sequence)->toBe("1, 2, fizz, 4, buzz, fizz, 7, 8, fizz, buzz, 11, fizz, 13, 14, fizzbuzz");
        });
        it('it returns fizz, 4, buzz for [3]', function () {
            $sequence = Number::convert([3, 4, 5]);
            expect($sequence)->toBe("fizz, 4, buzz");
        });
        it('it returns fizzbuzz for [15]', function () {
            $sequence = Number::convert([15]);
            expect($sequence)->toBe("fizzbuzz");
        });
    });
});