Starting Laravel First Project-To Make Simple Task Create-Delete-Edit

2
81

First Install Composer In Ubuntu PC:

The installer will just check a few PHP settings and then download composer.phar to your working directory

Installing Composer locally is a matter of just running the installer in your project directory

Now just run

in order to run Composer.

Then Move Composer to Your Target Directory

Now Now just run in Command Line

Start Project First:

Via Laravel Installer

First, download the Laravel installer using Composer:

Confirm to place directory $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS).

To Make New Dependencies, laravel new myblog will create a directory named project containing a fresh Laravel installation with all of Laravel’s dependencies already installed:

Via Composer Create New Project

Local Development Server to Run

If Use Server Like – Nginx

Following directive in your site configuration will direct all requests to the index.php front controller:

Ok Lets Go Main Project —

1) Create Auth And Database Migration Table using Command Line:

Then Create Model for Your Project Named ( Task ) in Model Folder

2) Then Create Controller to Control Task

If want to Linked with Individual Model and Controller Together then Put Code :

Actions Handled By Resource Controller

Verb URI Action Route Name
GET /tasks index tasks.index
GET /tasks/create create tasks.create
POST /tasks store tasks.store
GET /tasks/{task} show tasks.show
GET /tasks/{task}/edit edit tasks.edit
PUT/PATCH /tasks/{task} update tasks.update
DELETE /tasks/{task} destroy tasks.destroy

Open Routes->Web and Use Bellow Code

Then Use Code into Model with Migrate:

Replace Code into create_users_mytask Migration

New Task

 

@include(‘common.errors’)

{{ csrf_field() }}

 

 

 

 

 

@if (count($tasks) > 0)

Current Tasks

 

TaskCategoryEdit
@foreach ($tasks as $task)

{{ $task->category ? $task->category->title : “No Category” }}

{{ csrf_field() }} {{ method_field(‘DELETE’) }}  

@endforeach

{{ $task->name }}

 

@endif

 

@endsection