app/Http/Controllers/TagsController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {   
        $tags=[];
        foreach(Article::allTags()->get() as $val)
        {
            array_push($tags,$val->name);
        }
        return response()->json($tags);
    }
public function index ( Request $ request ) { $ tags = [ ] ; foreach ( Article :: allTags ( ) -> get ( ) as $ val ) { array_push ( $ tags , $ val -> name ) ; } return response ( ) -> json ( $ tags ) ; }
Display a listing of the resource.
Display a listing of the resource .