app/Http/Controllers/LivreController.php
/**
     * Display a specified resource
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
Display a specified resource
@param Request $request
@return \Illuminate\Http\JsonResponse
Display a specified resource @param Request $request @return \ Illuminate \ Http \ JsonResponse
public function show(Request $request)
    {
        $isbn = $request->input('isbn');
        if(empty(DescriptionLivre::where('ISBN_10',$isbn)->first()) && empty(DescriptionLivre::where('ISBN_13',$isbn)->first())){
            $bookDescription = Amazon::getBookFromIsbn($isbn);
        }
        else{
            $bookDescription =  array(DescriptionLivre::where('ISBN_10',$isbn)->orWhere('ISBN_13',$isbn)->first());
        }
        return response()->json(['status' => 200, 'books' => $bookDescription]);
    }
public function show ( Request $ request ) { $ isbn = $ request -> input ( 'isbn' ) ; if ( empty ( DescriptionLivre :: where ( 'ISBN_10' , $ isbn ) -> first ( ) ) && empty ( DescriptionLivre :: where ( 'ISBN_13' , $ isbn ) -> first ( ) ) ) { $ bookDescription = Amazon :: getBookFromIsbn ( $ isbn ) ; } else { $ bookDescription = array ( DescriptionLivre :: where ( 'ISBN_10' , $ isbn ) -> orWhere ( 'ISBN_13' , $ isbn ) -> first ( ) ) ; } return response ( ) -> json ( [ 'status' => 200 , 'books' => $ bookDescription ] ) ; }
Display a specified resource
 @param Request $request
 @return \Illuminate\Http\JsonResponse
Display a specified resource @param Request $request @return \ Illuminate \ Http \ JsonResponse
//We search for it in the database first //We search for it in the