Back

style not loading via route controller


I have setup blog and its' database with form submitting.It works all fine.The blog grid view also works fine with query.When accessing a specific ad individually it partially loads the page, yet the values are loaded.

controller

//store function
return redirect()->route('posts.show', $post->id);

//show function
 public function show($id)
    {    
        $post = Post::find($id);
        return view('user.productpage')->withPost($post);
    }

Routes

Route::get('create-ad', '[email protected]');
Route::post('create-ad', '[email protected]')->name('store'); 
Route::get('ads/{id}', '[email protected]')->name('posts.show');

Route::get('ads','[email protected]')->name('show_ads');

bladefile

@extends('layouts.main')

@section('content')
<h1>{{ $post->year}}</h1>

@endsection

Screenshot

What causes this. the css is working properly though. have run dump auto-load and artisan cache:clear .

Cameron replied 1 week ago

is that bladefile code above the user.productpage blade code?

can you try

return view('user.productpage', 
compact( 'post')
);
	
Cameron replied 1 week ago

also, if you are using webpack, it uses scss and compiles to public / css /app.css if that is the case in your app make sure your blade file is loading the css <link href="{{ asset('css/app.css') }}" rel="stylesheet"> or better <link rel="stylesheet" href="{{ mix('/css/app.css') }}">


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us