Laravel Angular CRUD (02) :: Model,View,Controller and Route configure

Today I’ll show you how to setup and configure our view,model,controller,routes for making crud system with angular js. Let’s see

You can read previous posts

You can find this project in my Github repository Laravel Angular CURD

First create a controller by command

php artisan make:controller TodoController

Now setup your Todo model like as below

<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Task extends Model {
    protected $fillable=['name','status'];

}

In public directory create some file like as below

js
  angular.min.js
scripts
  app.js
  controllers
     todo-controller.js

Now add these files in your app.blade.php template file

Add ng-app directive in your app.blade.php template file in body tag.

Open your route.php file and add a resource route

Route::resource('/todos','TodoController');

Now in your views directory create a todos folder and create a file inside todos folder name with index.blade.php

views
  todos
     index.blade.php
@extends('app')
  @section('content')
    <div class="container">
      <div class="row">
        <div class="col-md-12">
          <h3>Laravel Angular CRUD</h3>
          
        </div>
      </div>
    </div>
  @endsection

No more today.In next tutorial, I’ll discuss the next steps.

Tags : , , , , , ,

Share on :

Leave a Reply


four + 3 =