Diary Work 24/11/2019

1.Read about trigger in database.

What’s Trigger in the database. A trigger is a stored procedure in database. It automatically invokes whenever a special event in database occurs. It should be use in some case:

  • Create an audit trial of activity in the database. For example, you can track updates to the order table by updating corroborating to the audit table
  • Implement a business rule. You can determine an orders exceed the customer credit and display it.
  • Enforce referential integrity. For example, when delete a customer in customer, the trigger will delete corresponding customer row in order table.
  • Calculate. For example, when insert price and quantity product, the total column will be calculated by trigger

Syntax: create trigger [trigger_name] [before | after] {insert | update | delete} on [table_name] for each row [trigger body]For example: create trigger std_marks before INSERT on students for each row set student.total = student.subj1 + student.subj2;

2.Practice sub routing in laravel.

Sub routing is a way easier to manage and maintain router in laravel. When doing a large project which should be sub routing. There are several step to sub routing. For example:

  • Create a new file name admin in routes/admin.php
  • In RouteServiceProvider create a new function name mapAdminRoute.
  • The Code in function is: Route::prefix(‘admin’)->namespace(‘Auth/../../Admin’)->group(base_path(‘routes/admin.php’)).
  • In map function call mapAdminroute.
  • Now can write route in routes/admin.php
  • Create Controller in Admin folder and using normally.

3.Create Admin Display Project.

Create admin display follow admin template.Fix page moving left and right: html , body {with:100% !important;overflow-x: hidden !important;}

4.Deploy to docker using cron command.

Follow the instruction on the internet. Now can use cron on docker.

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar