Category : blogs

As the title says, when I try to use @foreach($posts as $post), I get an error that $post is undefined. I’m guessing I’ve probably made some simple mistake or something like that, but I haven’t been able to figure out what the problem is My blog.blade.php; @extends(‘user/app’) @section(‘title’,’TeknoMetot Blog’) @section(‘sub-heading’,’Teknolojiye dair her şey’) @section(‘main-content’) <!– ..

Read more

I try to create blog web page in laravel. While creating the post, the contents of the tag and category button are not visible. My edit.blade.php; @extends(‘admin.layouts.app’) @section(‘headSection’) <link rel=”stylesheet” href=”{{ asset(‘admin/plugins/select2/select2.min.css’) }}”> @endsection @section(‘main-content’) <!– Content Wrapper. Contains page content –> <div class=”content-wrapper”> <!– Content Header (Page header) –> <section class=”content-header”> <h1> Text Editors ..

Read more

I wanted to add comment to every post I make but I keep on getting errors. Comment Controller: public function store(Request $request) { $comments = new Comment; $comments->body =$request->get(‘comment_body’); $comments->user()->associate($request->user()); $blogs = Comment::find(1); $blogs->comments()->save($comments); return back(); } Comment Model: namespace AppModels; use IlluminateDatabaseEloquentFactoriesHasFactory; use IlluminateDatabaseEloquentModel; class Comment extends Model { use HasFactory; protected $guarded =[]; ..

Read more