[PHP] [BiuldYourFirstApp] build your first application: tracking notification

Source: Internet
Author: User
Tags dmca
[PHP] [BiuldYourFirstApp] to build your first application: tracking notification single article this article applies to beginners who have a certain understanding of PHP and laravel frameworks and have read the laravel getting started video: Laravel 5 Fundamentals. This article describes how to build a web application with simple registration, logon, form filling, text generation, preview, email sending, and display.

The video of the video author is often illegally uploaded to youtube. if you want to report to the relevant authorities, you must fill in a DMCA file with the source video address and the video address illegally uploaded, and express some demands. For convenience, the website is designed to enter a form to automatically generate DMCA files and send emails automatically.

If you haven't seen it yet, please download and watch it first:

  • Link: http://pan.baidu.com/s/1sjXeLQH
  • Password extraction: jjb5

1. modify the style of the returned data and return the View notices. index.

 Middleware ('auth'); // register a middleware to verify all methods. parent ::__ construct ();} public function index () {$ notices = $ this-> user-> notices ()-> latest ()-> get (); // sort notices return view ('Notices. index', compact ('notices');} public function create () {// get list of providers $ provider = Provider: list ('name ', 'id'); // load a view to create a new notice return view ('Notices. create ', compact ('Providers');} pubilcfunction confirm (PrepareNoticeRequest $ request) {$ template = $ this-> compileDmcaTemplate ($ data = $ request-> all (); session ()-> flash ('dmca ', $ data ); return view ('Notices. comfirm', compact ('Template'); // return a new view page and check the filled form data} public function store () {$ this-> creaeNotice ($ request); return redirect ('notices');} public function compileDmcaTemplate ($ data) {$ data = $ data + ['name' => $ this-> user-> name, 'Email '=> $ this-> user-> email,]; // input data for the template and splice the data return view ()-> file (app_path ('http/Templates/dmca. blade. php '), $ data);} private function createNotice (Request $ request) {$ notice = session ()-> get ('dmca ') + ['template' => $ request-> input ('Template')]; $ notice = $ this-> user-> notices ()-> save ($ notice ); return $ notice ;}}

2. create the view file index. blade. php.

@extends('app') @section('content')    YourNotices     
                     This Content:            AccessibleHere:            Is InfringingUponMyWorkHere:            NoticeSent:            ContentRemoved:                 @foreach ($noticesas $notice)                            {{ $notice->infringing_title }}                {!! link_to($notice->infringing_link) !!}                {!! link_to($notice->original_link) !!}                {{ $notice->created_at->diffForHumans() }}                                    {!! Form::open() !!}                    
  
                           {!! Form::checkbox('content_removed',$notice->content_removed,$notice->content_removed) !!}                    
   

{!! Form::close() !!} @endforeach ($noticesas $notice) @endsection

Summary

This section uses the created view index. blade. php to view sent notifications in descending order.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.