laravel

How to fix error Base table or view not found: 1146 Table laravel relationship table?

我与影子孤独终老i 提交于 2021-01-26 03:08:29
问题 I am a new of laravel I try to create relationship many to many between table,My problem when I am insert data in to database I got errors QueryException in Connection.php line 713: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'learn.category_posts' doesn't exist (SQL: insert into category_posts ( category_id , posts_id ) values (4, )) can anyone help me pls . and here below is my migrate and code: 2016_08_04_131009_create_table_posts.php public function up() { Schema::create(

PHP网站开发—网站架构优化性能概念

℡╲_俬逩灬. 提交于 2021-01-25 17:34:38
最开始的网站架构 最初业务量不大,访问量小,此时的架构,应用程序、数据库、文件都部署在一台服务器上,有些甚至仅仅是租用主机空间 1. 应用、数据、文件分离 将应用程序、数据库、文件各自部署在独立的服务器上,并且根据服务器的用途配置不同的硬件,达到最佳的性能效果。 2. 利用缓存改善网站性能 大部分网站访问都遵循28原则,即80%的访问请求,最终落在20%的数据上,所以我们可以对热点数据进行缓存,减少热点数据的访问路径,提高用户体验。缓存实现常见的方式是本地缓存、分布式缓存。当然还有CDN、反向代理。 2.1 本地缓存 本地缓存,顾名思义是将数据缓存在应用服务器本地,可以存在内存中,也可以存在文件,组件。本地缓存的特点是速度快,但因为本地空间有限所以缓存数据量也有限。 2.2 分布式缓存 分布式缓存的特点是,可以缓存海量的数据,并且扩展非常容易,在门户类网站中常常被使用,速度按理没有本地缓存快,常用的分布式缓存是Memcached、Redis。 2.3 反向代理 部署在网站的机房,当用户请求达到时首先访问反向代理服务器,反向代理服务器将缓存的数据返回给用户,如果没有缓存数据才会继续访问应用服务器获取,这样做减少了获取数据的成本。 2.4 CDN 假设我们的服务器都部署在杭州的机房,对于浙江的用户来说访问是较快的,而对于北京的用户访问是较慢的

After Search Export to PDF in Laravel?

半世苍凉 提交于 2021-01-25 06:57:10
问题 I have search data of the school now I like to export the searched only data into PDF. It is easy to send all just write $school=School::all() , but I like to send not all only searched data to PDF. For more information please see the attached pictures. all Schools and it information Once I searched I get this page: searched page Here is the code in Laravel controller. Search function: public function search(Request $request) { $camp_id=$request->camp_id; $school_level=$request->school_level;

After Search Export to PDF in Laravel?

拜拜、爱过 提交于 2021-01-25 06:56:29
问题 I have search data of the school now I like to export the searched only data into PDF. It is easy to send all just write $school=School::all() , but I like to send not all only searched data to PDF. For more information please see the attached pictures. all Schools and it information Once I searched I get this page: searched page Here is the code in Laravel controller. Search function: public function search(Request $request) { $camp_id=$request->camp_id; $school_level=$request->school_level;

Using Laravel bootstrap css to style only a section of a page

不羁岁月 提交于 2021-01-24 22:26:14
问题 I'm trying to use the default bootstrap css ( app.css ) that ships with Laravel to style a section of my page - specifically, the form section of my registration page. I don't want to include app.css in my html header as it gives me undesired effect on other parts of the page. So I want it to style only my html forms within the page. Currently, I've used either the asset() or HTML::style() methods like this within my form section: @section('form') <style> @import "{{ asset('css/app.css') }}";

Using Laravel bootstrap css to style only a section of a page

这一生的挚爱 提交于 2021-01-24 22:25:09
问题 I'm trying to use the default bootstrap css ( app.css ) that ships with Laravel to style a section of my page - specifically, the form section of my registration page. I don't want to include app.css in my html header as it gives me undesired effect on other parts of the page. So I want it to style only my html forms within the page. Currently, I've used either the asset() or HTML::style() methods like this within my form section: @section('form') <style> @import "{{ asset('css/app.css') }}";

Laravel Passport no authentication

时间秒杀一切 提交于 2021-01-24 12:29:23
问题 I have some strange problems with my laravel app. I have created an authentication system with Passport, I have installed everything as needed but I can't authenticate the user. When I log in it's creating a token correctly and everything seems to work fine, but when I want to add authentication in postman, it's always "Not Authenticated". This is happening with Laravel 8, I have copied everything from my Laravel 7 app and there is working pretty fine. I will provide you with some code. This

Laravel Passport no authentication

ぃ、小莉子 提交于 2021-01-24 12:29:03
问题 I have some strange problems with my laravel app. I have created an authentication system with Passport, I have installed everything as needed but I can't authenticate the user. When I log in it's creating a token correctly and everything seems to work fine, but when I want to add authentication in postman, it's always "Not Authenticated". This is happening with Laravel 8, I have copied everything from my Laravel 7 app and there is working pretty fine. I will provide you with some code. This

Laravel Passport no authentication

萝らか妹 提交于 2021-01-24 12:28:46
问题 I have some strange problems with my laravel app. I have created an authentication system with Passport, I have installed everything as needed but I can't authenticate the user. When I log in it's creating a token correctly and everything seems to work fine, but when I want to add authentication in postman, it's always "Not Authenticated". This is happening with Laravel 8, I have copied everything from my Laravel 7 app and there is working pretty fine. I will provide you with some code. This

Laravel 5.8 - save user emails encrypted

China☆狼群 提交于 2021-01-24 11:41:46
问题 I'm looking for a way to encrypt the user emails in the database. Since Encrypt always generates a different string, it fails. So I took sha1. in AuthenticatesUsers I've changed the credentials method to: protected function credentials(Request $request) { return ['email' => sha1(strtolower($request->email)), 'password' => ($request->password)]; } This works great for the login/registration. But there are problems with resetting the password. Resetting the password uses the