본문 바로가기
반응형

Framework52

[Laravel] Broadcast+Redis+Socket io 실시간 echo server 구축 Broadcasting(브로드캐스팅) 서버에 데이터가 변경되면 메세지가 웹 소캣 연결로 보내져 클라이언트에 의해 처리될 수 있도록 하는것. 라라벨에서 제공하는 브로드캐스트 드라이버로는(Pusher Channels, Redis,디버깅 용도의 log 드라이버)를 지원한다. 추가적으로 전체적으로 브로드캐스팅을 끌 수 있도록 해주는 null 드라이버도 제공된다. 각각의 드라이버의 설정 파일은 config/broadcasting.php 파일에 존재한다. Redis 데이터베이스, 캐시 및 메시지 브로커로 사용되는 오픈 소스 (BSD 라이선스), 인 메모리 데이터 구조 저장소이다. 쿼리 언어를 사용하지 않는 대표적인 NoSQL DBMS이다. Socket.io 실시간 웹 애플리케이션을위한 JavaScript 라이브러리.. 2020. 12. 2.
[Laravel] migration을 이용하여 컬럼 삭제, 수정 하기 Migration을 이용하여 컬럼 삭제, 수정을 하기 위해서는 doctrine/dbal 패키지가 필요하다. 컴포저를 사용하여 해당 패키지를 설치한다. composer require doctrine/dbal 컬럼 속성 변경 Schema::table('test', function (Blueprint $table) { $table->string('name', 50)->change(); }); 컬럼 이름 변경 Schema::table('test', function (Blueprint $table) { $table->renameColumn('from', 'to'); }); 컬럼 삭제 Schema::table('test', function (Blueprint $table) { $table->dropColumn('c.. 2020. 12. 1.
[Laravel] http request시 custom header 설정 하기 API Http Request시 보안을 위해 middleware를 사용해 헤더 설정을 해보았다. Route::group(['prefix'=>'api/v1', 'middleware' => [ApiToken::class]], function(){ Route::GET('test', [tetsController::class,'test']); }); prefix는 api 요청시 url 앞에 붙는 접두어 이며, 예를 들면 api call시 아래와 같이 요청 해야하며 request시 api/v1이 붙지 않는다면 404 error가 발생할 것이다. http://localhost/api/v1/test artisan 명령어로 원하는 middleware 이름을 입력한 후 실행 하면 미들웨어가 생성된다. php artisan.. 2020. 12. 1.
[Laravel] preg_match 오류 발생 시 이 에러가 발생한다면 web.php 에서 route부분에 오류가 나서 발생하는 에러인데 Route::get('auth/confirm/{code}', [ 'as' => 'users.confirm', 'uses' => 'UsersController@confirm', ])->where('code', '[\pL-\pN]{60}'); 코드 부분을 [a-zA-Z0-9]{60} 로 수정하여 해결하면 된다. 도움이 되셨다면 하트 및 댓글 부탁드립니다♥ 출처 : dev-joo.tistory.com/69 2020. 10. 7.
[Laravel] Migration 실행 시 errno: 150 "Foreign key constraint is incorrectly formed") Schema::create('users', function (Blueprint $table) { $table->engine = "InnoDB"; $table->increments('id')->unsigned(); $table->string('name'); $table->string('email')->unique(); $table->string('password'); $table->rememberToken(); $table->timestamps(); }); PK로 지정된 id컬럼을 다른 테이블에서 외래키 값으로 참조하려는 경우 해당 테이블의 외래키 컬럼과 PK로 지정된 컬럼의 속성이 같아야함 integer/ unsigned으로 속성을 주었기 때문에 참조하려는 테이블에서도 integer /unsigned 속.. 2020. 9. 16.
[Laravel] Postman으로 POST 요청 시 page expired Error 문제 https://robinz.in/csrf-token-session-error-with-laravel-on-ie-edge/ CSRF Token/Session Error with Laravel on IE or Edge Fix Laravel CSRF token mismatch errors and other session, cookie related issues on IE or Edge. Issue is with P3P policy and a middleware will help! robinz.in 2020. 2. 18.
반응형