FastReport也宣佈新版的5.6支援RAD Studio 10.2 Tokyo的Win32/Win64平台了!
Version 5.6
—————————
+ Added Embarcadero RAD Studio 10.2 Tokyo support for x32 and x64 windows platforms
+ Added Sup, Sub tag support for TfrxHTMLExport
+ Added TfrxPDFExport.SaveOriginalImages property. True by default
+ Added GS1 support for Code128C, EAN128C barcodes
+ Added sorting of printers by name in the printer’s list
+ Added Norwegian resources
+ Added TfrxFDTable support in the frxFDRTTI
+ Added #0..#31 chars support in the Code128A
+ Added TfrxBarcodeView.TestLine property
+ Added TfrxRichEditor form state storing
+ [Lazarus] Added support of GTK widget
– Fixed frx2xto30.pas for XE2 and later
– Increased PaperSizes count limit to 512
– [Lazarus] Fixed scrolling in designer
– Fixed smMaxHeight in TfrxRichView
– Fixed TfrxXLSXExport for file with 1000 worksheets
– Fixed TfrxPreviewPages.ClearPageCache
– Fixed TfrxIBXQuery.ExecSQL
– Fixed new event insert if main procedure of the script have line with “// begin”
– Fixed component’s name after Drag&Drop from Data Tree for fields with Unicode characters
– Fixed TfrxBarcodeView baCenter, baRight align
– Fixed reprint on new page and group keeping bug
– Fixed update parameters after loading for TfrxADOQuery
– Fixed preview’s toolbar for RAD Studio Berlin 10.1 Update 2 when VCL styles applied
– Fixed TfrxReport.PrintOptions.Duplex usage
– Fixed printing of PNG images
– Fixed TfrxReport.ReportOptions.Author in the DOCX, PPTX and XLSX exports
– Fixed vsExport usage for export filters
– Fixed export of non-alphanumeric chars (<, >, &) inside HTMLTags in the ODF export
– [FastScript] Fixed Format function
– Fixed HTMLTags in the TfrxMemoView
– Fixed calculation of hyperlink expressions
– Fixed image size in the DOCX export
– Fixed MSI barcode
– Fixed exporting of objects’ hyperlinks to encrypted PDF
– Fixed export to continuous XLSX for reports with many pictures
– Fixed export of frames with width < 1 to HTML
– Fixed export of empty pages to XLSX
– Fixed band’s with barcodes stretching
– Fixed KeepChild behavior for TfrxReportTitle child bands
– Fixed custom number format in the ODF export
– [Lazarus] Fixed printer selection in the print dialog
– Fixed export of hyperlinks with hkPageNumber kind when page number greater than pages count
– Fixed component’s name after Drag&Drop from Data Tree for some cases
– Fixed “Divizion by zero” error with pmSplit print mode
– Fixed PrintOnSheeet in the Print Dialog for some cases
– [Lazarus] Fixed default printer in the print dialog
– Fixed export images to BIFF8 for x64
– [Lazarus] Fixed printer selection before print properties dialog
– Fixed RAD Studio 10.1 Berlin size of dialog page issue in the designer
– Fixed exporting of numbers with ‘%’ in the format string (like #,##0.###%) in the BIFF8 export
– [Enterprse] Fixed “Report not found” error message
– Fixed “Print to file” option for GDI reports
– Fixed export to PDF with embedded fonts and empty memos
– Fixed export to PDF for HAlign = haBlock (GapX used now)
– Fixed font’s embedding for protected PDF if EmbedFontsIfProtected = False and EmbeddedFonts = True
– Fixed exporting of TfrxShapeView to XLSX and DOCX exports
– Fixed exporting of Unicode characters in the memos with HTML tags to DOCX for non-Unicode IDE
– Fixed TfrxPreviewButtons in the frxClassRTTI
– Fixed parent for objects for some cases
– Fixed font’s name in the ODF export
Schema::create('notes', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->string('content');
$table->timestamps();
});
於down函數中加入
Schema::drop('notes');
九、建立資料庫
dos模式下
php artisan migrate
十、新增model
dos模式下
php artisan make:model Note
十一、修改app\Note.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Note extends Model
{
//
protected $table ='notes';
public $fillable = ['title','content'];
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Note;
use Validator;
use App\Http\Requests;
use Response;
use Illuminate\Support\Facades\Input;
class NoteController extends Controller
{
public function api()
{
return view('/api');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$notes = Note::latest()->paginate(6); //每頁為6
$response = [
'pagination' => [
'total' => $notes->total(),
'per_page' => $notes->perPage(),
'current_page' => $notes->currentPage(),
'last_page' => $notes->lastPage(),
'from' => $notes->firstItem(),
'to' => $notes->lastItem()
],
'data' => $notes
];
return response()->json($response);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request,[
'title' => 'required',
'content' => 'required',
]);
$create = Note::create($request->all());
return response()->json($create);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this->validate($request,[
'title' => 'required',
'content' => 'required',
]);
$edit = Note::find($id)->update($request->all());
return response()->json($edit);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
Note::find($id)->delete();
return response()->json(['done']);
}
}
十四、修改routes\web.php
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
//Route::get('/', function () {
// return view('welcome');
//});
Route::get('/', 'NoteController@api');
Route::get('/api', 'NoteController@index');
Route::resource('vuenotes','NoteController');