Cách Code Comment Như Của Facebook
Bạn có thể dùng sẵn plugin của Facebook, đầy đủ chức năng giống hệt luôn này https://developers.facebook.com/docs/plugins/comments/
Giải pháp cho việc đăng hàng loạt video từ 1 folder lên page facebook.
Có API của facebook kèm hướng dẫn dễ hiểu thực sự đấy bạn https://developers.facebook.com/docs/video-api/guides/publishing/
Tối ưu laravel
public function childrenCategories()
{
return $this->hasMany('App\DaiLy', 'nguoigt', 'affID')->with('childrenCategories')->select('id','affID','nguoigt');
}
Có thể đoạn đệ quy này gây ra việc tốn nhiều query đấy
Các pro Laravel cho em hỏi chút về Query Builder với ạ
Mình thấy cách này ổn mà, dự án của mình cũng đang viết các query theo kiểu như vậy.
Xin demo về Laravel Product Variants
Bạn có thể tham khảo table structure của plugin Woocommerce của Wordpress, nó khá nổi trong việc xây dựng website bán hàng. https://github.com/woocommerce/woocommerce/wiki/Database-Description
Xử lý Cookie trong laravel
Đơn giản bạn chỉ cần dùng tới facade này trong controller để lấy cookie Illuminate\Support\Facades\Cookie;
$value = Cookie::get('name');
và để set cookie vào response bạn dùng
Cookie::queue('name', 'value', $minutes);
Laravel-echo-server: Cách fix lỗi 'Preparing authentication request to: http://localhost:8000'
Không phải lỗi đâu bạn, do bạn broadcasting qua private channel nên cần phải xác thực thôi. Bạn có thể tìm hiểu về cấu hình authentication cho channel ở đây https://laravel.com/docs/7.x/broadcasting#defining-authorization-callbacks
Tạo 1 đồng Bitcoin thứ 2 nhưng 100% giống với bitcoin hiện tại
Nhưng liệu
đồng Bitcoin thứ 2 nhưng 100% giống với bitcoin hiện tại
đào lên có giá trị gì không =))
Liên quan tới config Nginx và PHP-FPM
Bạn chọn đường dẫn nào cũng được, vì /var/run
thực tế chỉ symlink tới /run
thôi mà.
Render iframe từ Kibana trong ReactJS như nào?
render() {
const url = `https://viblo.asia`
return (
<div>
<iframe src={url} style={{border: 'none', height: '100vw', width: '100%'}} allowFullScreen />
</div>
)
}
Thay chiếc link của kibana vào là ok luôn mà =))
Làm sao để tăng điểm Reputations trên Viblo ạ?
Thăm ngàn, kiệp ngần... Dịch ra là Viết bài, tích cực trả lời câu hỏi =))
Hỏi về laravel
Có khi nào trong model bạn đang sử dụng Mutator https://laravel.com/docs/7.x/eloquent-mutators#introduction
Nuxtjs, thẻ <a> trong content và <a href=''#abc"
- Bạn dùng cái này thay cho thẻ
a
nhé https://nuxtjs.org/api/components-nuxt-link - Ban thử cách này nhé
<nuxt-link :to="{path: '/', hash: 'anchor'}" v-scroll-to="{el: '#anchor'}">link</nuxt-link>
componentDidMount
Phải chăng bạn có init dữ liệu trong state
của component rồi chăng ?
Lỗi update PHP 5.6 lên PHP 7.3
Bác phải up version php
trước, package đang require php 7.1
nên chưa update được kìa.
--> Processing Dependency: php(language) >= 7.1.3 for package: phpMyAdmin-5.0.2-2.el6.remi.noarch
--> Finished Dependency Resolution
Error: Package: php-symfony4-common-4.1.13-1.el6.remi.noarch (remi)
Requires: php(language) >= 7.1.3
parent::properties trong OOP PHP
Dùng parent:: là một cách giúp code clean hơn đó bạn. Trong 1 lớp con, có parent:: trỏ tới lớp cha, và self:: tương ứng với lớp hiện tại.
parent::properties trong OOP PHP
Ở lớp con, bạn muốn dùng thuộc tính của lớp cha thì bạn dùng $this->thuoc_tinh_o_lop_cha
để sử dụng nhé.
class MyParent {
protected $data;
public function __construct() {
$this->someMethodInTheParentClass();
}
protected function someMethodInTheParentClass() {
$this->data = 123456;
}
}
class Child extends MyParent {
public function __construct() {
parent::__construct();
}
public function getData() {
return $this->data; // will return the $data property
// that's defined in the MyParent class
}
}
Cài đặt larave 7
bác đã chạy npm run dev
chưa ?
sau khi cài laravel/ui thì bác chạy thêm 2 lệnh này nữa
php artisan ui bootstrap
php artisan ui vue
PHP- tăng thời gian đợi khi load website
Do max_execution_time đặt giới hạn 300s nên request chỉ chạy 5 phút thôi đó. Bạn thử tìm file php.ini tăng lên đi. https://docs.presscustomizr.com/article/171-fixing-maximum-upload-and-php-memory-limit-issues
Xin hỏi cách config nginx VPS
Bác restart lại nginx service chưa ?
sudo service nginx restart