Why with resource is not executing in Laravel

Asked
Active3 hr before
Viewed126 times

2 Answers

90%

Meta Stack Overflow , Stack Overflow help chat , Stack Overflow Public questions & answers , Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers

Here in my controller i have added the EventsResource and at there i have added the with function but in output its not executing or something I can't able to figure out. I have added the output please check. Here is my controller part.

class EventsController extends Controller {
   /**
    * Display a listing of the resource.
    *
    * @return \Illuminate\Http\Response
    */
   public
   function index() {
      //
      $event = Event::with('eventCategory') - > get();
      return EventsResource::collection($event);

   }
load more v
88%

This directory structure allows you to render the accordion component and its item like so:,When writing components for your own application, components are automatically discovered within the app/View/Components directory and resources/views/components directory.,The command above will create an Input component in the App\View\Components\Forms directory and the view will be placed in the resources/views/components/forms directory.,{tip} If you need to conditionally compile classes on other HTML elements that shouldn't receive merged attributes, you can use the @class directive.

Blade views may be returned from routes or controller using the global view helper. Of course, as mentioned in the documentation on views, data may be passed to the Blade view using the view helper's second argument:

Route::get('/', function() {
   return view('greeting', ['name' => 'Finn']);
});
load more v

Other "undefined-undefined" queries related to "Why with resource is not executing in Laravel"