summerblue / laravel-shop Goto Github PK
View Code? Open in Web Editor NEWLaravel 电商实战教程的项目代码
Laravel 电商实战教程的项目代码
How to install it?
配置好后打开首页报错
{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [products]","resource.type":"index_or_alias","resource.id":"products","index_uuid":"na","index":"products"}],"type":"index_not_found_exception","reason":"no such index [products]","resource.type":"index_or_alias","resource.id":"products","index_uuid":"na","index":"products"},"status":404}
应该怎么创建索引来着?
// Laravel-Admin 没有 axios,使用 jQuery 的 ajax 方法来请求
return $.ajax({
url: '{{ route('admin.orders.handle_refund', [$order->id]) }}',
type: 'POST',
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (SQL: select count(*) as aggregate from products
where on_sale
= 1)
nginx日志如下;
➜ logs cat nginx_common_error.log
2019/02/01 15:22:54 [error] 71536#0: *41 open() "/Applications/MxSrvs/www/shop/public/products" failed (2: No such file or directory), client: 127.0.0.1, server: dev.shop.com, request: "GET /products HTTP/1.1", host: "dev.shop.com"
看了一下路由文件,好像没有什么问题;
翻了一下以前的issues,也没有类似的问题;
求助;
我直接在GitHub上down下来的,分支(L05_5.7)
php.exe artisan admin:install安装导致表编码和排序都是utf8mb4,
错误:
Migrating: 2014_10_12_000000_create_users_table
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users
add unique users_email_unique
(email
))
不知是本地原因还是框架本身原因
框架Laravel Framework 5.7.17
PHP 7.2.22 (cli) (built: Aug 28 2019 09:29:01) ( ZTS MSVC15 (Visual C++ 2017) x64 )
windows10
10.1.24-MariaDB, for Win32 (AMD64)
我创建的数据库是utf8 -- UTF-8 Unicode的编码以及utf8_general_ci排序
但是一执行artisan admin:install 就报错,把user表设置为了CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;,然后给email字段设置unique索引的时候就会报超出767个字节错误,我不能挨个改字段长度,我也不能挨个加编码,我只能手动改框架本身的设置,统一默认设置为utf8以及utf8_unicode_ci排序,
请问一下这是我操作的问题还是项目本身的问题?
报这个错误是什么原因呢?
在model,order中
public static function findAvailableNo()
{
// 订单流水号前缀
$prefix = date('YmdHis');
for ($i = 0; $i < 10; $i++) {
// 随机生成 6 位的数字
$no = $prefix.str_pad(random_int(0, 999999), 6, '0', STR_PAD_LEFT);
// 判断是否已经存在
if (!static::query()->where('no', $no)->exists()) {
return $no;
}
usleep(100);
}
\Log::warning(sprintf('find order no failed'));
return false;
}
public static function getAvailableRefundNo()
{
do {
// Uuid类可以用来生成大概率不重复的字符串
$no = Uuid::uuid4()->getHex();
// 为了避免重复我们在生成之后在数据库中查询看看是否已经存在相同的退款订单号
} while (self::query()->where('refund_no', $no)->exists());
return $no;
}
看到一个使用self::query
一个 使用 static::query
这两处为什么不保持统一,是说注意到了self和static的区别,还是忽略
L05_* 和 L06_* 以及 advanced 这几个分支分别对应哪个教程的?
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'homestead.products' doesn't exist (SQL: select count(*) as aggregate from products
where on_sale
= 1)
Hello
I would ask you is there any plan for translation to the Persian/farsi language ?
can i install on windows with xampp?
es 添加数据的时候同事加入Es里面去了,那删除的时候呢
不支持复合型sku么
👉 resources\lang\zh-CN\admin.php
为什么部署到线上后 url 为本地 127.0.0.1 地址
比如登录地址是 http://127.0.0.1:8000/login
应该在哪里设置这个地址
All the data I see is empty.
This is critical vulnerability. If not known impect, look at this document: https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)
The interactive pages @csrf code must be added.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.