خرید بک لینک

Vote count: 0

Hi so i'm following the Laracasts But i'm pretty stuck because i'm not sure why i'm getting the error ~: Method CarbonCarbon::__toString() must not throw an exception

here is my code;

<?php

namespace AppHttpControllers;


use AppHttpRequestsCreateArticleRequest;
use AppArticle;
use AppHttpRequests;
use AppHttpControllersController;

use Request;
use CarbonCarbon;

class ArticlesController extends Controller
{
public function index()    {
    $articles= article::all();

   retu view ('articles.index',compact ('articles')); 
}

public function show($id){

  $article= article::findOrFail($id);

   retu view ('articles.show',compact ('article')); 

}

public function create(){

    retu view('articles.create');

}

public function store(Request $request){
    $input = Request::class;
    $input['published_at'] = Carbon::now();

    Article::create($input);

    retu redirect('articles');
}

}
}

and here is my front end:

@extends ('app')

@section('content')

<h1> Write a New Article </h1>

<hr/>


{!! Form::open(['url' => 'articles']) !!}
<div class="form-group">
    {!! Form::label('title', 'Title:') !!}
    {!! Form::text('title', null, ['class' => 'form-control']) !!}

</div>
<!-- FORM INPUT HEEEEERREEEE -->
<div class="form-group">
    {!! Form::label('body','Body:') !!}
    {!! Form::textarea('body', null, ['class' => 'form-control']) !!}

</div>

<!-- Add Article field -->
<div class="form-group">
    {!! Form::submit('Add Article',['class' => 'btn btn-primary form-control'] ) !!}

</div>

{!! Form::close() !!}


@stop

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 9 ارديبهشت 1395 ساعت: 16:11

صفحه بندی