I was working my way through the phpacademy tutorial "Laravel To Do List App" and after I completed the Marking Tasks (Part 6/9) chapter -> https://www.youtube.com/watch?v=wtnGE7HW0io&index=6&list=PLfdtiltiRHWGH8AngyP6cp525_R_NExcR
I found that marking items was not saving and just reloading the page.
I was running my MAMP server and accessing it via localhost/tuts/laravel/todoapp/public I dont know why this was happening but once I moved to php artisan serve everything worked as expected.
Does anyone know what this works or what is happening.
is there any error ?
Laravel can use with MAMP. it need (php 5.4, mcrypt).
I recommend you to use Vagrant and homestead.
for more information.
No error but it doesn't update the database. I use the Form::open() in blade for making the form.
In normal htdocs the form action reads: http://localhost/tutorials/laravel/todo_app/public In artisan serve it reads: http:://localhost:8000
These are the files and code used. It works ok using artisan server but not going through regular MAMP. All other features work ok, adding and deleting
// route file
Route::post('/', array('uses' => 'HomeController@postIndex'))->('csrf');
// HomeController
public function postIndex()
{
$id = Input::get('id');
$item = Item::findOrFail($id);
if($item->owner_id == Auth::user()->id)
{
$item->mark();
}
}
// mark
public function mark()
{
$this->done = $this->done ? false : true;
$this->save();
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community