Category: Code

Laravel Ajax Button

Laravel Ajax Button

in blade <button class=”btn-xs btn-info grant_access” data-options='{“user_id”:”{{ $user->id }}”, “action”: “remove”, “role_id” : {{ $role_id }}, “_token”: “{{ Session::token() }}” }’>Has Access<h;/button> <script> $(‘.grant_access’).click(function(){ var options = $(this).data( “options”); var sel = $(this); //console.log(options);...

Laravel Logs generated by crontab permission denied

Laravel Logs generated by crontab permission denied

I had a problem with logs being generated by crontab not being accessible by my server user.  The reason was that the crontab was being run by the ec2-user and the apache user is...

Limit Server Options Requests

Limit Server Options Requests

in httpd.conf <IfModule hmod_allowmethods> AllowMethods GET POST OPTIONS </IfModule> In each VirtualHost directive ## Disallow OPTIONS METHOD RewriteEngine On RewriteCond %{REQUEST_METHOD} !(GET|POST) RewriteRule .* – [F] This seems to stop the majority of the...

PHP Namespace resources and Autoloading with Composer

PHP Namespace resources and Autoloading with Composer

Fantastic Article about them https://www.thoughtfulcode.com/a-complete-guide-to-php-namespaces/ Composer Autoloading Resources https://phpenthusiast.com/blog/how-to-autoload-with-composer PHP JWT REST API Authentication https://www.codeofaninja.com/2018/09/rest-api-authentication-example-php-jwt-tutorial.html https://github.com/firebase/php-jwt

JWT authentication and resources

JWT authentication and resources

So much to look at. Where to Store your JWTs – Cookies vs HTML5 Web Storage Authentication in Cognito using JWT Encode or Decode JWT Debug and Peek at JWTs – JWT.io php JWT...

AWS Cognito for Facebook Login

AWS Cognito for Facebook Login

Excellent videos covering setting up and implementing AWS Cognito for a web app. This is a great solution for handing User registration and authentication for multiple systems.

Installing Yarn on Mojave

Installing Yarn on Mojave

I was unable to install yarn directly – I had to do a few additional steps for it to actually work. Here they are. I installed using homebrew for mac once homebrew was installed...

Working and testing redirects for Apache

Working and testing out redirects for Apache To work on a testing local install of the site make sure you have a local installation of the site you are trying to put redirects in...

Take Care of your .Git (folder)

Take Care of your .Git (folder)

In Light of Japan’s Ebay source code getting leaked! Some websites host their version control repository (e.g. .git/) in production. Bad people can use tools to download/restore the repository to gain access to your...

0

Laravel Save Form Post

php artisan make:migration tasks in database / migrations / create tasks table – paste in up()  function Schema::create(‘tasks’, function (Blueprint $table) { $table->increments(‘id’); $table->string(‘title’); $table->text(‘body’); $table->timestamps(); }); php artisan make:model Task in class Task...