probleme chargement @include

Ce sujet est résolu
Default
,

Bonjour,

Voila je rencontre un petit problème avec mon code.

Ce que je fais

Décrivez ici votre code ou ce que vous cherchez à faire
depuis edit.blade.php
faire @include('posts.form')
voici le dossier form.blade. php

<?php
if ($post->id) {

    $options = ['method' => 'put', 'url' => action('PostsController@update', $post)];
} else {

    $options = ['method' => 'posts', 'url' => action('PostsController@store')];
}
?>


{!! Form::model($post, $options) !!}
<div class="form-group">
    {!! Form::label('title' , 'Titre') !!}
    {!! Form::text('title' , null, ['class' => 'form-control']) !!}

</div>
<div class="form-group">
    {!! Form::label('slug' , 'URL') !!}
    {!! Form::text('slug' , null, ['class' => 'form-control']) !!}

</div>
<div class="form-group">
    {!! Form::label('category_id' , 'Categorie') !!}
    {!! Form::select('category_id' , $categories, null, ['class' => 'form-control']) !!}


</div>

<div class="form-group">
    {!! Form::label('tags' , 'Categorie') !!}
    {!! Form::select('tags' , App\Tag::lists('name', 'id') , null, ['class' => 'form-control']) !!}


</div>

<div class="form-group">
    {!! Form::label('content' , 'Contenu') !!}
    {!! Form::textarea('content' , null, ['class' => 'form-control']) !!}

</div>

<div class="form-group">

    <label >

        {!! Form::checkbox('online' , 1) !!}
        En ligne ?
    </label>

</div>
<button class="btn btn-primary">Envoyer</button>
{!!Form::close() !!}

PostsControler.php

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;


use App\Http\Controllers\Controller;

use App\Post;

use App\Category;

use App\Tag;




class PostsController extends Controller
{

public function index()

{
 $posts = Post::with('category')->get();

return view('posts.index' , compact('posts', 'categories'));

}

public function create()

{
    $post = new Post();
 $categories = category::lists('name', 'id');   
 return view('posts.create' , compact('post','categories'));
}


public function store(Request $request)

{
 $post = Post::create($request->all());
 return redirect(route('news.edit', $post));

}

public function show($id)
{

 $post = Post::published()->where('id', $id)->firstOrFail();
 return $post;
}


public function edit($id)

{
  $post = Post::findOrFail($id);
  $categories = Category::lists('name', 'id');
  return view('posts.edit', compact('post', 'categories'));

}

public function update($id, Request $request)

{
 $post = Post::findOrFail($id);
 $post->update($request->all());
 $post->tags()->sync($request->get('tags'));
 return redirect(route('news.edit', $id));
}

public function destroy($id)

{

}


}

edit.blade.php

@extends('layouts.master')


@section('content')

 <h1>Editer</h1>

 @include('posts.form')

@stop

ouvrir la page avec l'include mais seul :

<h1>Editer</h1> 

s'affiche
le template ne s'affiche pas non plus ....

@extends('layouts.master')

master.blade.php

<!doctype html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="icon" href="../../../../favicon.ico">

        <title>@yield('title')</title>

        <!-- Bootstrap core CSS -->
        <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">


    </head>

    <body style="padding-top: 50px">

        <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
            <a class="navbar-brand" href="#">Navbar</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarsExampleDefault">
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item active">
                        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">Link</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link disabled" href="#">Disabled</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
                        <div class="dropdown-menu" aria-labelledby="dropdown01">
                            <a class="dropdown-item" href="#">Action</a>
                            <a class="dropdown-item" href="#">Another action</a>
                            <a class="dropdown-item" href="#">Something else here</a>
                        </div>
                    </li>
                </ul>
                <form class="form-inline my-2 my-lg-0">
                    <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
                    <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
                </form>
            </div>
        </nav>

        <div class="container" style="padding-top: 40 px">

                <div class="starter-template">
                    <div class="row">
                      <div class="col-sm-8">

                        @yield('content')   
                      </div>
                <div class="col-sm-4">
                    @section('sidebar')
                         je suis une sidebar
                    @show()
                </div>
            </div>

            </div>

        </div><!-- /.container -->

        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
        <script>window.jQuery || document.write('<script src="../../../../assets/js/vendor/jquery-slim.min.js"><\/script>')</script>
        <script src="../../../../assets/js/vendor/popper.min.js"></script>
        <script src="../../../../dist/js/bootstrap.min.js"></script>
    </body>
</html>

et j'ai l'erreur :

edit Failed to load resource: the server responded with a status of 500 (Internal Server Error)

dans inspecter la page ?

Pourriez vous m'aider pour resoudre le probleme et afficher la page ,
Merci d'avance pour vos futur reponse :)

Cordialement

8 Réponse

48315
,

Bonjour,

Voici quelques piste:
1. dans 'layouts.master' remplace les scripts par les cdn

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
  1. si tu utilises Xampp ou Wamp essaye de ne pas les utiliser en service mais en activation manuelle (j'ai déjà rencontré ce problème).

Voilà, c'est tout ce que je peux te conseiller pour l'instant :-)

44576
,

Bonjour,

Il faudrait que tu puisses accéder aux logs PHP, est-ce que le mode DEBUG est activé dans le fichier de configuration .env ? :)

Default
,

Bonjour

APP_DEBUG=true

il est bien activer , qu'elle est la suite de la marche a suivre .

Merci d'avance pour ta prochaine reponse .
cordialement

Default
,

Bonjour,

Pourrait ont m'aider .

Merci d'avance :)

44576
,

Essaye de remplacer @stop par @endsection

Default
,

[(https://myfordbenefits.info/)]

Default
,

Default
,

http://icdcodes.xyz/[]()