<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rheadavin Adhiskara on Medium]]></title>
        <description><![CDATA[Stories by Rheadavin Adhiskara on Medium]]></description>
        <link>https://medium.com/@adhiskara?source=rss-3705d8614e00------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bU4UoSvj_kbayWN1XaDdNw.jpeg</url>
            <title>Stories by Rheadavin Adhiskara on Medium</title>
            <link>https://medium.com/@adhiskara?source=rss-3705d8614e00------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 11:15:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adhiskara/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Flutter: CRUD dengan Laravel API(CRUD with Laravel REST API) Part I — Read]]></title>
            <link>https://adhiskara.medium.com/flutter-crud-dengan-laravel-api-crud-with-laravel-rest-api-part-i-read-a77f24d012e3?source=rss-3705d8614e00------2</link>
            <guid isPermaLink="false">https://medium.com/p/a77f24d012e3</guid>
            <category><![CDATA[flutter-crud]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-mysql]]></category>
            <category><![CDATA[laravel-api]]></category>
            <category><![CDATA[flutter-laravel]]></category>
            <dc:creator><![CDATA[Rheadavin Adhiskara]]></dc:creator>
            <pubDate>Sun, 02 May 2021 05:53:19 GMT</pubDate>
            <atom:updated>2021-05-02T05:53:19.800Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flutter: CRUD dengan Laravel API(CRUD with Laravel REST API) Part I — Read</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qisMUmEuW_z8ko7Y1Xk7Jw.jpeg" /></figure><p>Halo semua!</p><p>In this article I will share tutorial Flutter: How to make CRUD with Laravel REST API Part I (Read Data). This tutorial continues in part <a href="https://adhiskara.medium.com/membuat-login-flutter-dengan-api-laravel-flutter-authentication-with-laravel-2c7f0fef66dc">Membuat Login Flutter dengan API Laravel (Flutter Authentication with Laravel)</a></p><h3>Read Data</h3><p>In this part I will share tutorial How to <strong><em>display data</em></strong> with Laravel REST API</p><p><strong>Table Student</strong></p><p>Prepare the table that you want to use. For example here I use a student table with a structure like this.</p><pre>CREATE TABLE `student` (<br>  `id_student` int(10) NOT NULL,<br>  `student_name` varchar(25) NOT NULL,<br>  `gender` enum(&#39;Male&#39;,&#39;Female&#39;) NOT NULL,<br>  `birth_date` date NOT NULL,<br>  PRIMARY KEY(`id_student`)<br>);</pre><p><strong>Insert some data</strong></p><pre>INSERT INTO `student`<br>(`id_student`, `student_name`, `gender`, `birth_date`) VALUES<br>(1001, ‘Andreas Neil’, ‘Male’, ‘2006–04–18’),<br>(1002, ‘Bob Lee Swagger’, ‘Male’, ‘2006–07–07’),<br>(1003, ‘Cindy Octavia’, ‘Female’, ‘2006–10–12’);</pre><h3>Laravel REST API</h3><p>Prepare your Laravel project as well, and create a model for your table. Here I am creating a student model for my student table</p><p><strong>Student Model</strong></p><pre>class Student extends Model<br>{<br> protected $table = ‘student’;<br> protected $primaryKey = ‘id_student’;<br> protected $fillable = [<br> ‘student_name’,<br> ‘gender’,<br> ‘birth_date’<br> ];<br> public $timestamps = false;<br>}</pre><p><strong>Student Controller</strong></p><p>Create a controller for the student’s CRUD function</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d72eb2bf06919f35f61e383b6d80229a/href">https://medium.com/media/d72eb2bf06919f35f61e383b6d80229a/href</a></iframe><p><strong>api.php</strong></p><p>The <strong>middleware</strong> means that to access the route <strong>requires login</strong></p><pre>Route::get(‘student’, ‘StudentController@index’)-&gt;middleware(‘auth:api’);</pre><h3>Flutter Project Structure</h3><p>First create a project structure like this, because login and register have been in the previous tutorial, this time create a <strong>model</strong> and <strong>service</strong> for student table that are used as models and controllers in flutter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*2qHjDpQywjIgixDp7dng9g.png" /><figcaption>lib project structure</figcaption></figure><p><strong>Student.dart</strong></p><p>You can adjust the parameters in the model according to your table.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c59a6a85434eda165dec5fced6280cfa/href">https://medium.com/media/c59a6a85434eda165dec5fced6280cfa/href</a></iframe><p><strong>StudentService.dart</strong></p><p>This service is used to capture the results of the API route that we send.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b3c8e0d0a222d73fed124e92ee31150/href">https://medium.com/media/2b3c8e0d0a222d73fed124e92ee31150/href</a></iframe><p><strong>home.dart</strong></p><p>This page is used to display the data with Table Widget.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ffaf1c98d9255bd80413c4684e0900fb/href">https://medium.com/media/ffaf1c98d9255bd80413c4684e0900fb/href</a></iframe><p><strong>student_detail.dart</strong></p><p>This page is used to display detailed student data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba736f66f9f4524a76435cba85f5cc4f/href">https://medium.com/media/ba736f66f9f4524a76435cba85f5cc4f/href</a></iframe><h3>Test Drive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzIfsNfTbBizMme22OP3QA.jpeg" /><figcaption>Home and Detail Student Page</figcaption></figure><p>Having some issues? Let me know, write on comment below, cheers!</p><h3>Thank you very much! Terima Kasih!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a77f24d012e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Membuat Login Flutter dengan API Laravel (Flutter Authentication with Laravel)]]></title>
            <link>https://adhiskara.medium.com/membuat-login-flutter-dengan-api-laravel-flutter-authentication-with-laravel-2c7f0fef66dc?source=rss-3705d8614e00------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c7f0fef66dc</guid>
            <category><![CDATA[flutter-login-ui]]></category>
            <category><![CDATA[flutter-laravel]]></category>
            <category><![CDATA[flutter-login]]></category>
            <category><![CDATA[flutter-authentication]]></category>
            <category><![CDATA[flutter-auth]]></category>
            <dc:creator><![CDATA[Rheadavin Adhiskara]]></dc:creator>
            <pubDate>Fri, 26 Mar 2021 13:01:59 GMT</pubDate>
            <atom:updated>2021-03-26T13:01:59.518Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ln1oPanVYSrs7dirNWZ0LQ.jpeg" /></figure><p>Halo semua!</p><p>In this article I will share tutorial How to make Flutter authentication with Laravel Rest API. This tutorial continues in part <a href="https://adhiskara.medium.com/membuat-api-otentikasi-laravel-laravel-rest-api-authentication-with-passport-f507faca3bd9">Membuat API Otentikasi Laravel (Laravel Rest API Authentication with Passport)</a>.</p><h3><strong>Tools</strong></h3><ul><li><strong>Flutter</strong>, definitely.</li><li><strong>Laravel. </strong>(Here I will using Laravel 5.8)</li><li><strong>VS Code</strong></li><li><strong>Postman</strong></li></ul><h3>Setup Laravel Backend</h3><p>Read this detailed article specially for building basic authentication <a href="https://adhiskara.medium.com/membuat-api-otentikasi-laravel-laravel-rest-api-authentication-with-passport-f507faca3bd9">Laravel Rest API</a>. Once you are ready, move to the next step.</p><h3><strong>Create a Flutter Application</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*eFjyM8RaAJPmB4LBQlYb-w.png" /><figcaption>Create new project on VS Code</figcaption></figure><p><strong>Install Flutter Packages</strong></p><p>We are going to use some Flutter packages:</p><p><strong><em>http</em></strong> package, to consume HTTP resources.</p><p><strong><em>shared_preferences</em></strong> package, providing a local storage for simple data.</p><p>Add the packages to your <strong><em>pubspec.yaml</em></strong></p><pre>dependencies:<br>  shared_preferences: ^0.5.12+4<br>  http: ^0.12.2</pre><p>Run the command <strong><em>flutter pub get</em></strong></p><p><em>Note: You can use other versions of these packages according to the version of the Dart SDK you are using.</em></p><h3><strong>Project Structure</strong></h3><p>Create your project structure like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/212/1*UKWjuX4zhLDRf0E45dzflA.png" /><figcaption>lib folder structure</figcaption></figure><p>Within the lib directory create 2 folders:</p><ul><li>network ( create api.dart file )</li><li>screens ( create login.dart, home.dart, register.dart files )</li></ul><h4><strong>network/api.dart</strong></h4><p>In the <strong><em>api.dart</em></strong> file, write a class that manages all API methods</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/935ff7a730ff87fa5124efdedf250a95/href">https://medium.com/media/935ff7a730ff87fa5124efdedf250a95/href</a></iframe><p>Notice that, define <strong><em>String _url = ‘http://192.168.1.2/lara_passport/api/v1’</em></strong> this is basically the base url for our Laravel API.</p><p><strong>lara_passport </strong>is my laravel directory on XAMPP.</p><p><strong>var token</strong> is a variable that will store API token for authentication and would be attached to every request that requires authentication.</p><p>We used <strong>SharedPreferences</strong> to allow us to store the logged in user to the local storage. Once the user has login to the application, does’nt have to login again.</p><h4>main.dart</h4><p>This is the first class that run in your application. Here we will check if the user is authenticated and return to the home screen or the login screen.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c9fe2f7bf9704995cb30cfa0cdf4351/href">https://medium.com/media/2c9fe2f7bf9704995cb30cfa0cdf4351/href</a></iframe><h4>screens/login.dart</h4><p>You can copy and paste from the code below or build a form for yourself.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f1b8d64ef22339e02c72834c9e20e436/href">https://medium.com/media/f1b8d64ef22339e02c72834c9e20e436/href</a></iframe><p>Define a boolean <strong><em>_isLoading = false; </em></strong>is to change the state of the login button text.</p><p>Define <strong><em>email </em></strong>and <strong><em>password </em></strong>variables, their values from their respective form fields after validation.</p><p><strong>void _login() </strong>is a process to send a login data with an API. The results obtained from the API are read in JSON form. If you are successfully login, <strong>SharedPreferences </strong>will be store your account data and redirect to the Home Screen. If you can’t log in, it will display a notification <strong>_showMsg()</strong></p><h4>screens/register.dart</h4><p>this file is similar to login.dart, significant change is in the form name field, and in the API route ‘/register’ as screen below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f26dd9dddf03cc9151a57cf957cb6a9/href">https://medium.com/media/0f26dd9dddf03cc9151a57cf957cb6a9/href</a></iframe><h4>screens/home.dart</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/882c44d184ea3a8187c43dec3accf858/href">https://medium.com/media/882c44d184ea3a8187c43dec3accf858/href</a></iframe><p>At the <strong><em>initState() </em></strong>method is the first initialization method that is executed when the page is loaded. We call <strong><em>_loadUserData </em></strong>which returns the user data during register/login.</p><h3>Test Drive</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u49xKI-P-JHde3bHUFRWUg.jpeg" /></figure><p>Here is my git repository for the Flutter auth with Laravel Rest API.</p><p><a href="https://github.com/rheadavin/flutter_auth">rheadavin/flutter_auth: Flutter Authentication with Laravel API Passport (github.com)</a></p><p>Having some issues? Let me know, write on comment below, cheers!</p><h3>Thank you very much! Terima Kasih!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c7f0fef66dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Membuat API Otentikasi Laravel (Laravel Rest API Authentication with Passport)]]></title>
            <link>https://adhiskara.medium.com/membuat-api-otentikasi-laravel-laravel-rest-api-authentication-with-passport-f507faca3bd9?source=rss-3705d8614e00------2</link>
            <guid isPermaLink="false">https://medium.com/p/f507faca3bd9</guid>
            <category><![CDATA[flutter-authentication]]></category>
            <category><![CDATA[laravel-passport]]></category>
            <category><![CDATA[flutter-laravel]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[laravel-api]]></category>
            <dc:creator><![CDATA[Rheadavin Adhiskara]]></dc:creator>
            <pubDate>Fri, 26 Mar 2021 03:59:31 GMT</pubDate>
            <atom:updated>2021-03-26T04:14:24.368Z</atom:updated>
            <content:encoded><![CDATA[<p>Halo semua!</p><p>In this article, I will share How to make Rest API Authentication Laravel with Passport. Basically, we will be creating a Login, Register and Logout API endpoint. Mari belajar bersama!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*3RQjTmt0e5-O-wHYwZoIuQ.png" /><figcaption>source: laravel.com</figcaption></figure><p><strong>What is Laravel Passport?</strong></p><blockquote>Laravel Passport provides a full OAuth2 server implementation for your Laravel application in a matter of minutes. Passport is built on top of the League OAuth2 server that is maintained by Andy Millington and Simon Hamp — laravel.com</blockquote><p>Next, run a fresh Laravel instalation. In this article, I will use <strong><em>Laravel 5.8</em></strong></p><p><strong>Tools</strong></p><ul><li>XAMPP</li><li><a href="https://www.postman.com/downloads/">Postman</a>. I suggest you to use Postman to test your API</li></ul><p><strong>Installing Laravel</strong></p><p>Open your command line and run the command:</p><pre>composer create-project --prefer-dist laravel/laravel lara_passport &quot;5.8.*&quot;</pre><p>After successfull instalation, create your own databse and edit the database config section in <strong><em>.env</em></strong> file.</p><pre>DB_CONNECTION=mysql<br>DB_HOST=127.0.0.1<br>DB_PORT=3306<br>DB_DATABASE=larapassport<br>DB_USERNAME=root<br>DB_PASSWORD=</pre><p><strong>Installing Laravel Passport</strong></p><p>Within your project directory, run the command:</p><pre>composer require laravel/passport</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*zvCC8tSkiURpTV6mzH-34Q.png" /></figure><p>Run migration</p><pre>php artisan migrate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*YD884F_WBm5fzPu3csUhUQ.png" /></figure><p><strong>Create Encryption Keys</strong></p><p>Next, you should run the passport:install on your command line</p><pre>php artisan passport:install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*y12JCskUCHuD96Vi-g8laA.png" /></figure><blockquote>After running this command, import Laravel\Passport\HasApiTokens on your App/User model. This trait will provide a few helper methods to your model which allow you to inspect the authenticated user’s token. Here is my full code</blockquote><pre>&lt;?php</pre><pre>namespace App;</pre><pre>use Illuminate\Notifications\Notifiable;<br>use Illuminate\Foundation\Auth\User as Authenticatable;<br>use Laravel\Passport\HasApiTokens;</pre><pre>class User extends Authenticatable<br>{<br> use HasApiTokens, Notifiable;</pre><pre>protected $fillable = [<br> ‘name’, ‘email’, ‘password’,<br> ];</pre><pre>protected $hidden = [<br> ‘password’, ‘remember_token’,<br> ];</pre><pre>protected $casts = [<br> ‘email_verified_at’ =&gt; ‘datetime’,<br> ];<br>}</pre><blockquote>Next, insert Passport::routes method on the boot method of <em>app/Providers/AuthServiceProvider.php. </em>This method will register the routes necessary to issue access tokens and revoke access tokens, clients, and personal access tokens. This is my full code</blockquote><pre>&lt;?php</pre><pre>namespace App\Providers;</pre><pre>use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;<br>use Illuminate\Support\Facades\Gate;<br>use Illuminate\Support\Facades\Schema;<br>use Laravel\Passport\Passport;</pre><pre>class AuthServiceProvider extends ServiceProvider<br>{<br> protected $policies = [<br> ‘App\Model’ =&gt; ‘App\Policies\ModelPolicy’,<br> ];</pre><pre>public function boot()<br> {<br> $this-&gt;registerPolicies();<br> Passport::routes();<br> }<br>}</pre><p>In your <strong><em>config/auth.php </em></strong>set the driver option of the api authentication guard to passport. Change your configuration like this</p><pre>‘guards’ =&gt; [<br> ‘web’ =&gt; [<br> ‘driver’ =&gt; ‘session’,<br> ‘provider’ =&gt; ‘users’,<br> ],</pre><pre>‘api’ =&gt; [<br> ‘driver’ =&gt; ‘passport’,<br> ‘provider’ =&gt; ‘users’,<br> ],<br> ],</pre><p><strong>Start Creating API Endpoints</strong></p><p>Open your <strong><em>route/api.php </em></strong>and change your route like this</p><pre>&lt;?php</pre><pre>use Illuminate\Http\Request;</pre><pre>Route::group([&#39;prefix&#39; =&gt; &#39;v1&#39;], function(){<br> Route::post(&#39;login&#39;, &#39;UsersController@login&#39;);<br> Route::post(&#39;register&#39;, &#39;UsersController@register&#39;);<br> Route::get(&#39;logout&#39;, &#39;UsersController@logout&#39;)-&gt;middleware(&#39;auth:api&#39;);<br>});</pre><p>Next, we will create API for login, register and logout. Run the command to make a UsersController</p><pre>php artisan make:controller UsersController</pre><p><strong>Login Function</strong></p><pre>&lt;?php</pre><pre>namespace App\Http\Controllers;</pre><pre>use Illuminate\Http\Request;<br>use Validator;<br>use App\User;<br>use Auth;</pre><pre>class UsersController extends Controller<br>{<br> public function login(){<br>  if(Auth::attempt([&#39;email&#39; =&gt; request(&#39;email&#39;), &#39;password&#39; =&gt; request(&#39;password&#39;)])){<br>   $user = Auth::user();<br>   $success[&#39;token&#39;] = $user-&gt;createToken(&#39;appToken&#39;)-&gt;accessToken;<br>   return response()-&gt;json([<br>    &#39;success&#39; =&gt; true,<br>    &#39;token&#39; =&gt; $success,<br>    &#39;user&#39; =&gt; $user,<br>   ]);<br>  } else{<br>   return response()-&gt;json([<br>    &#39;success&#39; =&gt; false,<br>    &#39;message&#39; =&gt; &#39;Invalid Email or Password&#39;,<br>   ], 401);<br>  }<br> }<br>}</pre><p><strong>Register Function</strong></p><pre>public function register(Request $request){<br>  $validator = Validator::make($request-&gt;all(), [<br>   &#39;name&#39; =&gt; [&#39;required&#39;, &#39;string&#39;, &#39;max:255&#39;],<br>   &#39;email&#39; =&gt; [&#39;required&#39;, &#39;string&#39;, &#39;email&#39;, &#39;max:255&#39;, &#39;unique:users&#39;],<br>   &#39;password&#39; =&gt; [&#39;required&#39;, &#39;string&#39;, &#39;min:8&#39;],<br>  ]);<br>  if($validator-&gt;fails()){<br>   return response()-&gt;json([<br>    &#39;success&#39; =&gt; false,<br>    &#39;message&#39; =&gt; $validator-&gt;errors(),<br>   ], 401);<br>  }<br>  $input = $request-&gt;all();<br>  $input[&#39;password&#39;] = bcrypt($input[&#39;password&#39;]);<br>  $user = User::create($input);<br>  $success[&#39;token&#39;] = $user-&gt;createToken(&#39;appToken&#39;)-&gt;accessToken;<br>  return response()-&gt;json([<br>   &#39;success&#39; =&gt; true,<br>   &#39;token&#39; =&gt; $success,<br>   &#39;user&#39; =&gt; $user<br>  ]);<br> }</pre><p><strong>Logout Function</strong></p><pre>public function logout(Request $request){<br>  if(Auth::user()){<br>   $user = Auth::user()-&gt;token();<br>   $user-&gt;revoke();</pre><pre>return response()-&gt;json([<br>    &#39;success&#39; =&gt; true,<br>    &#39;message&#39; =&gt; &#39;Logout successfully&#39;,<br>   ]);<br>  } else{<br>   return response()-&gt;json([<br>    &#39;success&#39; =&gt; false,<br>    &#39;message&#39; =&gt; &#39;Unable to Logout&#39;,<br>   ]);<br>  }<br> }</pre><p><strong>Test the API</strong></p><p>Now, it’s time to test the API that we have created. Start the server with type command php artisan serve.</p><p>Open Postman, and enter the URL that have been you made on API routes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*HopGCQF27C3MTr7TXZcHcQ.png" /></figure><p>If you are using Laravel 5.8 and get some issues like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*TL4763t7Uv0U_CNLv6GH2A.png" /><figcaption>Replicating claims as headers is deprecated and will removed from v4.0.</figcaption></figure><p>Open your command line and type this</p><pre>composer require lcobucci/jwt=3.3.3</pre><p>Test again on Postman, and boom!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P23G_rLQAyTK35-AiHagdQ.png" /><figcaption>Register successfully</figcaption></figure><p>Login Test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuZGTy8eSrU91jur74Am6w.png" /><figcaption>Login successfully</figcaption></figure><p>Logout Test</p><p>Copy the token value, and set the header on Postman</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xh5TyqjAWL8-kl0YxUlr3A.png" /><figcaption>Set header with Authorization</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*Pg3ubAD0qVB3Lpkmx80Wtg.png" /><figcaption>Logout successfully</figcaption></figure><p>Hope this is usefull, you can build as many secured APIs as you wish using Laravel.</p><p>Having issues? Do let me know. Write on comments, cheers!</p><h3><strong>Thank you very much! Terima kasih!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f507faca3bd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara Install Flutter di Windows 10 (How to Install Flutter on Windows 10)]]></title>
            <link>https://adhiskara.medium.com/cara-install-flutter-di-windows-10-how-to-install-flutter-on-windows-10-21c8c4539353?source=rss-3705d8614e00------2</link>
            <guid isPermaLink="false">https://medium.com/p/21c8c4539353</guid>
            <category><![CDATA[visual-studio-flutter]]></category>
            <category><![CDATA[how-to-install-flutter]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-windows]]></category>
            <category><![CDATA[cara-instal-flutter]]></category>
            <dc:creator><![CDATA[Rheadavin Adhiskara]]></dc:creator>
            <pubDate>Thu, 25 Mar 2021 11:04:06 GMT</pubDate>
            <atom:updated>2021-03-25T12:19:18.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnH9jqNuMJeeo1NXTI7eXw.jpeg" /><figcaption>source: flutter.dev</figcaption></figure><p>Halo semua!</p><p>This time I want to share a tutorial How to Install Flutter on Windows 10. As you know, application development technology is growing rapidly. Therefore, let’s prepare by getting know with Flutter. Mari belajar bersama!</p><p><strong>Tools</strong></p><ul><li><a href="https://git-scm.com/download/win">Git for Windows</a> 2.x, with the <strong>Use Git from the Windows Command Prompt</strong> option.</li><li><a href="https://code.visualstudio.com/download">Visual Studio Code</a>, I advise you to use VS Code</li><li>Android Virtual Device, I use AVD by <a href="https://developer.android.com/studio?hl=id">Android Studio</a></li></ul><p><strong>Flutter SDK —</strong><a href="https://flutter.dev/docs/development/tools/sdk/releases"><strong> Download here</strong></a></p><p>For beginners, I recommend choosing the latest version of the Futter SDK with the Stable Channel type. You can download on <a href="https://flutter.dev/docs/development/tools/sdk/releases">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*T9A_JMmUnMnZeEpzUx0NDg.png" /></figure><p>Extract the Flutter SDK that you downloaded on Disk C:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*18j-yD9yoXk344c_DfgQHw.png" /></figure><p>After you extract the Flutter SDK, set the Environment Variables to the Path variable. Customize the path with your own folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*JjCxYKS1IoIZYauytZuRAw.png" /></figure><p><strong>Step for Android Studio users:</strong></p><p>If you are <strong><em>not</em></strong> using Android Studio, you can skip this step.</p><ol><li>Open your Android Studio, and Open Configure &gt; Plugins</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*MY-qUIR8fpxOQnibcHVBVQ.png" /></figure><p>2. On the Marketplace tab, search ‘flutter’, install it, and then Restart IDE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*hKbtah8_91kXAH-t0de_Tg.png" /></figure><p>3. Open again Android Studio, and click Start a new Flutter projects. Choose Flutter Application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*P2E81kJdcmDg3oa2dKjXew.png" /></figure><p>4. Configure your flutter application. Choose Flutter SDK path on Disk C:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*LK5aWfJviwrNRH1j7VgwNg.png" /></figure><p>5. Set package name, you can adjust your package name for the Flutter application. Checklist the AndroidX</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*bvuPHT_u-etPi69Z-u-39w.png" /></figure><p>Boom! Your Flutter apps is ready.</p><p><strong>Step for Visual Studio Code users</strong></p><p>You can create the Flutter Application with VS Code.</p><ol><li>Open your VS Code, and go to View tab &gt; Command Palette..</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*Cwh6wv15lVz2Pb1zQAmxfQ.png" /></figure><p>2. Type ‘flutter’, and select the <strong>Flutter: New Application Project</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*Ho0SX9ENq9TCTEHd2JurWA.png" /></figure><p>3. Select folder to save your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*NWiZ4RkSQRCqVmM-_Kre0w.png" /></figure><p>4. Enter a project name, such as <strong><em>flutter_application</em></strong>, and press <strong>Enter</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*68yZfzg_wSgso63kdxbjdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3J-DcS6_5owJyAQTa3-T7Q.png" /></figure><p>Wait, and Boom! Your Flutter Apps is ready!</p><p><strong>Test Drive</strong></p><ol><li>Open Terminal / CMD / PowerShell and go to the flutter folder</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*Wg9no0FAPxh4JMDmLOdgWg.png" /></figure><p>2. Type on your command:</p><pre>flutter doctor</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*of1VqJ95malyKH-M0ST3SA.png" /></figure><p>If you have some issues with Android toolchain ([!] Some Android licenses not accepted…). The reason is: You are required to agree to the license (terms &amp; conditions) from Android first.</p><p>The trick is to type</p><pre>flutter doctor --android-licenses</pre><p>Enter: <strong>Y</strong> to accept the license</p><p>And then check back with flutter doctor to see if there are any more issues.</p><p>Hope it is useful. Thank you very much and see you on next tutorial.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21c8c4539353" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning Menggunakan Python]]></title>
            <link>https://medium.com/group-3-machine-learning/machine-learning-menggunakan-python-6f0de5fc4fa2?source=rss-3705d8614e00------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f0de5fc4fa2</guid>
            <dc:creator><![CDATA[Rheadavin Adhiskara]]></dc:creator>
            <pubDate>Fri, 01 Nov 2019 03:19:24 GMT</pubDate>
            <atom:updated>2019-11-01T03:19:24.113Z</atom:updated>
            <content:encoded><![CDATA[<p>By : Ryan Palevi Zakaria</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*ngbwG_7RBzb2FgGVw4AxcQ.png" /><figcaption>Ilustrasi Gambar</figcaption></figure><p>Machine Learning adalah jenis kecerdasan buatan (AI) yang emungkinkan komputer untuk belajar tanpa pemrograman eksplisit. Machine Learning berfokus pada pembuatan program komputer yang dapat berubah saat terpapar dengan data baru. Pada artikel ini, kita akan melihat dasar-dasar Machine Learning dan algoritma Machine Learning sederhana menggunakan python yang akan diimplementasikan.</p><blockquote><strong>Machine Learning overview</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*tmNFU_qbjigFVgg4rOgIDg.jpeg" /><figcaption>Ilustrasi gambar praktik</figcaption></figure><p>Machine Learning melibatkan pengajaran komputer menggunakan data set yang diberikan dan menggunakan praktik untuk memprediksi sifat-sifat data baru yang diberikan. Misalnya, dengan memberi makan 1000 gambar kucing dan 1000 gambar lainnya yang bukan kucing, kita dapat melatih komputer dan memberi tahu komputer setiap kali apakah gambar itu kucing atau bukan. Maka jika kita menunjukkan gambar baru ke komputer, komputer harus dapat mengetahui apakah gambar baru ini adalah kucing atau bukan dari praktik di atas.</p><p>Pelatihan dan proses prediksi melibatkan penggunaan algoritma khusus. Kami memasukkan training data ke dalam algoritma, dan training data ini digunakan oleh algoritma untuk memprediksi test data baru. Algoritma lain seperti itu adalah klasifikasi K-Nearest-Neighbor (klasifikasi KNN). Dibutuhkan test data dan set test data untuk mencari nilai data terdekat untuk data ini. Kemudian ia memilih tetangga frekuensi maksimum dan memberikan karakteristiknya sebagai hasil prediksi. Misalnya, jika set of trainingnya adalah:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*t8Qjt_Q_MHBaA4Cwga1j9w.png" /></figure><p>Sekarang kami ingin memprediksi jenis flower untuk petal ukuran 2,5 cm. Jadi jika kita setuju tetangga no (K) = 3, kita melihat bahwa 3 tetangga terdekat 2.5 adalah 1, 2 dan 3. Frekuensi mereka masing-masing adalah 2, 3 dan 2. Oleh karena itu tetangga frekuensi maksimum adalah 2 dan jenis flower yang sesuai adalah b. Jadi prediksi untuk petal ukuran 2,5 adalah jenis flower b.</p><p>Jadi kita telah melihat bagaimana Machine Learning bekerja dan mengembangkan program dasar untuk mengimplementasikannya menggunakan python.</p><p>Baca Juga &gt;&gt; <a href="https://medium.com/group-3-machine-learning/algoritma-knn-k-nearest-neighbor-1e34fb6cf7a3"><strong>Algoritma KNN</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f0de5fc4fa2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/group-3-machine-learning/machine-learning-menggunakan-python-6f0de5fc4fa2">Machine Learning Menggunakan Python</a> was originally published in <a href="https://medium.com/group-3-machine-learning">Group 3 Machine Learning</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algoritma KNN (K-Nearest Neighbor)]]></title>
            <link>https://medium.com/group-3-machine-learning/algoritma-knn-k-nearest-neighbor-1e34fb6cf7a3?source=rss-3705d8614e00------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e34fb6cf7a3</guid>
            <dc:creator><![CDATA[Rheadavin Adhiskara]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 15:46:11 GMT</pubDate>
            <atom:updated>2019-10-31T15:46:11.303Z</atom:updated>
            <content:encoded><![CDATA[<h4>Mengenal apa itu algoritma KNN pada Machine Learning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRjBNJw15zb9o0QZnNerug.jpeg" /><figcaption>sumber: VectorStock</figcaption></figure><h3>Apa itu Algoritma K-Nearest Neighbor?</h3><p>Algoritma k-NN merupakan salah satu dari algoritma supervised learning. Mengenai pembahasan supervised learning telah dibahas melalui artikel sebelumnya, dapat diakses melalui link berikut: <a href="https://medium.com/group-3-machine-learning/supervised-learning-74c9f4e8ab0b">disini</a>. Mengapa k-NN dikatakan sebagai algoritma supervised learning? Karena k-NN bekerja secara langsung pada sampel yang dipelajari (data latih) dibandingkan membuat rule/aturan seperti algoritma lainnya.</p><h3>Banyaknya k-Tetangga Terdekat</h3><p>Untuk mengimplementasikan algoritma k-NN, perlu menentukan jumlah kluster yang digunakan untuk melakukan klasifikasi data baru. Banyaknya kluster(k) sebaiknya berjumlah ganjil, seperti k = 1, 3, 5, dan seterusnya. Penentuan jumlah kluster yang akan diimplementasikan dipertimbangkan berdasarkan banyaknya data yang ada. Semakin banyak data, jumlah kluster yang dipilih sebaiknya berjumlah rendah. Namun semakin besar jumlah data, kluster yang dipilih sebaiknya semakin tinggi.</p><h3>Implementasi Algoritma K-NN</h3><blockquote>Bertanya pada Tetangga — Ketika orang terdekat kita mengidap penyakit diabetes. Namun, kita tidak tahu apakah kita juga bisa terjangkit penyakit diabetes juga atau tidak. Yang kita tahu, pola makan yang kita jalani sehat-sehat saja. Tetapi, pola makan belum menjamin juga apakah kita memiliki tanda-tanda mengidap diabetes atau tidak. Faktor lainnya yaitu ada kadar gula yang kita konsumsi, berat badan, umur, dan juga faktor genetik dari keturunan. Lalu, apakah kita dapat memprediksi penyakit diabetes melalui algoritma k-NN?</blockquote><p>Untuk memprediksi hasil positif dan negatif mengidap penyakit diabetes diatas akan diimplementasikan menggunakan bahasa pemrograman Phyton dengan menggunakan Anaconda Jupyter Notebook.</p><ol><li>Siapkan dataset yang akan digunakan, disini saya menggunakan dataset yang telah di download sebelumnya <a href="https://www.kaggle.com/saurabh00007/diabetescsv">disini</a>. Upload dataset ke server Jupyter Notebook.</li><li>Buat file Python 3 baru dengan cara klik New-&gt;Python 3 dan beri nama pada file tersebut. Import semua package yang dibutuhkan dan lakukan masukan nama file dataset yaitu diabetes.csv. Dataset yang saya gunakan telah diubah menjadi 50 sampel. Lima variavel diukur dari sampel meliputi: Glucosa(Gula), BMI(Berat Badan), DiabetesPedigreeFunction(Genetik), dan Age(Umur).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*6FNuaRYXzNQ-i2O2K4KNbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*xLu8UH6kN21dqhDtc5aDtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*7FnXTlW9faFsyt71oWTwog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*geQZZtXmxXt-0Y50ouu71g.png" /><figcaption>Gambar 1</figcaption></figure><p>3. Buat diagram boxplot untuk masing-masing variabel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*cN_dktUJsGGJfE5FuwJNWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*LoN1mUSVG2HSH8CEhqbOXg.png" /><figcaption>Gambar 2</figcaption></figure><p>Dari boxplot di atas, dapat dilihat variabel Glucosa terletak diantara data 100 hingga 150. Lalu, variabel BMI terletak diantara data 20 hingga 40. Variabel DiabetesPedigreeFunction terletak dibawah angka 1. Yang terakhir, variabel umur berada di rentan 30 hingga 50</p><p>4. Menampilkan scatter plot dari semua variabel untuk melihat sebaran data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*UpnlYhRzCuRYLIYniwUhkg.png" /><figcaption>Gambar 3</figcaption></figure><p>5. Sebelum masuk ke analisis K-NN, import sklearn pada program, kemudian ketikkan script program seperti dibawah. Script dibagi menjadi 2 bagian data 80% untuk data training, dan 20% untuk data test, sehingga pada test_size=0.2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*XzhPHniikxdt8HUZ_YX23A.png" /></figure><p>6. Setelah data di-split menjadi 80% untuk training set, dan 20% untuk test set, selanjutnya masuk ke analisis K-NN. Ketikkan script berikut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*KezQATI4yZELdKXzvjDbSg.png" /><figcaption>Gambar 4</figcaption></figure><p>Tujuan dari penggunaan metode analisis ini yaitu untuk menentukan faktor-k yang sesuai dari accuracy yang dihasilkan. Semakin tinggi akurasi, maka faktor-k tersebut yang akan dijadikan referensi untuk semua data set. Diketahui bahwa klustering dengan nilai k=5 didapat Accuracy yaitu 0.6 atau dapat dikatakan 60%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*sLjvgDKXUfO-53M6oo_Wdg.png" /><figcaption>Gambar 5</figcaption></figure><p>Dari Gambar 5, hasil klustering dengan nilai k=3 adalah 0.7 atau 70%, dan ini merupakan akurasi paling tinggi dibandingkan dengan k=5 dan k=1.</p><p>Dari kedua hasil diatas, dapat disimpulkan bahwa tingkat akurasi pengujian model penentuan diabetes menggunakan algoritma K-NN ini dipengaruhi oleh klustering data.</p><p>Akhir kata, mohon maaf apabila ada kesalahan. Semoga dapat bermanfaat, Terima Kasih.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e34fb6cf7a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/group-3-machine-learning/algoritma-knn-k-nearest-neighbor-1e34fb6cf7a3">Algoritma KNN (K-Nearest Neighbor)</a> was originally published in <a href="https://medium.com/group-3-machine-learning">Group 3 Machine Learning</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>