Warning: Creating default object from empty value in /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php on line 29

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 96

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 98

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 260

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 262

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 283

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 351

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/targostar/public_html/wp-content/plugins/wp-jalali/lib/date.php on line 353

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/targostar/public_html/wp-content/plugins/seoaal-core-/admin/ReduxCore/inc/class.redux_filesystem.php:29) in /home/targostar/public_html/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":1278,"date":"2020-01-06T13:07:24","date_gmt":"2020-01-06T09:37:24","guid":{"rendered":"http:\/\/tou.targostar.net\/?p=1278"},"modified":"2020-01-09T01:42:36","modified_gmt":"2020-01-09T06:42:36","slug":"%d8%b3%d8%a7%d8%ae%d8%aa-%d9%88%d8%a8-%d8%b3%d8%b1%d9%88%db%8c%d8%b3-%d8%af%d8%b1-%d9%84%d8%a7%d8%b1%d8%a7%d9%88%d9%84","status":"publish","type":"post","link":"http:\/\/targostar.net\/%d8%b3%d8%a7%d8%ae%d8%aa-%d9%88%d8%a8-%d8%b3%d8%b1%d9%88%db%8c%d8%b3-%d8%af%d8%b1-%d9%84%d8%a7%d8%b1%d8%a7%d9%88%d9%84\/","title":{"rendered":"\u0633\u0627\u062e\u062a \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u062f\u0631 \u0644\u0627\u0631\u0627\u0648\u0644"},"content":{"rendered":"\r\n

\u0633\u0627\u062e\u062a \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0644\u0627\u0631\u0627\u0648\u0644<\/a> \u06f5\u066b\u06f7<\/strong><\/h3>\r\n

API \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0634\u0646\u0627\u062e\u062a\u0647 \u0645\u06cc \u0634\u0648\u062f. \u0622\u06cc\u0627 \u0634\u0645\u0627 \u062f\u0646\u0628\u0627\u0644 \u0627\u06cc\u0646 \u0645\u06cc \u06a9\u0631\u062f\u06cc\u0646 \u06a9\u0647 \u0686\u0637\u0648\u0631 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0631 \u0644\u0627\u0631\u0627\u0648\u0644 \u06f5\u066b\u06f7 \u0645\u06cc\u0634\u0647 restful api \u0633\u0627\u062e\u062a\u061f \u0627\u06af\u0631 \u0628\u0644\u0647 \u0645\u0646 \u0627\u06cc\u0646\u062c\u0627 \u0642\u062f\u0645 \u0628\u0647 \u0642\u062f\u0645 \u0622\u0645\u0648\u0632\u0634 \u0622\u0646 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0634\u0645\u0627 \u0646\u0648\u0634\u062a\u0647 \u0627\u0645 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u0628\u0627 \u067e\u0627\u0633\u067e\u0648\u0631\u062a.<\/p>\r\n

\u0627\u0645\u0631\u0648\u0632\u0647\u060c \u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0645\u06cc \u062f\u0627\u0646\u06cc\u062f \u0644\u0627\u0631\u0627\u0648\u0644 \u0628\u0647 \u062e\u0627\u0637\u0631 \u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0627\u0645\u0646\u06cc\u062a\u06cc \u0627\u0634 \u0628\u0633\u06cc\u0627\u0631 \u0645\u062d\u0628\u0648\u0628 \u0627\u0633\u062a. \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0646\u062f\u06af\u0627\u0646\u060c \u0644\u0627\u0631\u0627\u0648\u0644 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0628\u0631\u0627\u06cc \u0633\u0627\u062e\u062a \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0627\u0646\u062a\u062e\u0627\u0628 \u0645\u06cc \u06a9\u0646\u0646. \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u062e\u06cc\u0644\u06cc \u0645\u0647\u0645 \u0627\u0633\u062a \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0634\u0645\u0627 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u0648\u0628 \u0648 \u0627\u067e\u0644\u06cc\u06a9\u06cc\u0634\u0646 \u0631\u0648 \u0628\u0633\u0627\u0632\u06cc\u062f \u0686\u0648\u0646 \u062f\u0631 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0634\u0645\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u06cc\u06a9 \u0628\u0627\u0646\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc \u0628\u0633\u0627\u0632\u06cc\u062f \u0648 \u0628\u0627 \u0647\u0645\u0627\u0646 \u0633\u0627\u062e\u062a\u0627\u0631 \u06a9\u0627\u0631 \u06a9\u0646\u06cc\u062f.<\/p>\r\n

\u0627\u06af\u0631 \u0634\u0645\u0627 \u0644\u0627\u0631\u0627\u0648\u0644 \u0631\u0648 \u0646\u0645\u06cc \u0634\u0646\u0627\u0633\u06cc\u062f \u06cc\u0627 \u0646\u0645\u06cc \u062f\u0627\u0646\u06cc\u062f \u06a9\u0647 \u0686\u0637\u0648\u0631 \u0633\u0627\u062e\u062a \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0628\u0627 \u0644\u0627\u0631\u0627\u0648\u0644 \u0631\u0648 \u0634\u0631\u0648\u0639 \u06a9\u0646\u06cc\u062f \u0646\u06af\u0631\u0627\u0646 \u0646\u0628\u0627\u0634\u06cc\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0645\u0646 \u0642\u062f\u0645 \u0628\u0647 \u0642\u062f\u0645 \u0628\u0631\u0627\u06cc \u0633\u0627\u062e\u062a \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u062a\u0648\u0636\u06cc\u062d \u062e\u0648\u0627\u0647\u0645 \u062f\u0627\u062f. \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0645\u0631\u062d\u0644\u0647 \u06cc\u0647 \u0645\u0631\u062d\u0644\u0647 \u0645\u0627 \u0631\u0648 \u062f\u0646\u0628\u0627\u0644 \u06a9\u0646\u06cc\u062f.<\/p>\r\n

    \r\n
  • \u0646\u0635\u0628 \u0644\u0627\u0631\u0627\u0648\u0644 \u06f5\u066b\u06f7 :<\/li>\r\n<\/ul>\r\n

    \u0645\u0646 \u0642\u0635\u062f \u062f\u0627\u0631\u0645 \u0642\u062f\u0645 \u0628\u0647 \u0642\u062f\u0645 \u0645\u0631\u0627\u062d\u0644 \u0631\u0627 \u062a\u0648\u0636\u06cc\u062d \u0628\u062f\u0647\u0645 \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u0645\u0627 \u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u0622\u062e\u0631\u06cc\u0646 \u0646\u0633\u062e\u0647 \u0644\u0627\u0631\u0627\u0648\u0644 \u0631\u0648 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u062f \u0632\u06cc\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0646\u06cc\u0645. \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0645\u0646\u0638\u0648\u0631 \u062e\u0637 \u0641\u0631\u0645\u0627\u0646 \u0631\u0627 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f \u0648 \u062f\u0631 \u0622\u0646 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f<\/p>\r\n

    composer create-project –prefer-dist laravel\/laravel blog<\/p>\r\n

     <\/p>\r\n

      \r\n
    • \u0646\u0635\u0628 \u067e\u0627\u0633\u067e\u0648\u0631\u062a: <\/strong><\/li>\r\n<\/ul>\r\n

      \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0631\u062d\u0644\u0647 \u0645\u0627 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u0645 \u06a9\u0647 \u067e\u0627\u0633\u067e\u0648\u0631\u062a \u0631\u0627 \u0646\u0635\u0628 \u06a9\u0646\u06cc\u0645 \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u06cc\u06a9 \u062e\u0637 \u0641\u0631\u0645\u0627\u0646 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f \u0648 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0622\u0646 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\r\n

      composer require laravel\/passport<\/p>\r\n

       <\/p>\r\n

      \u0628\u0639\u062f \u0627\u0632 \u0646\u0635\u0628 \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0627\u06cc\u0646 \u067e\u06a9\u06cc\u062c\u060c \u0645\u0627 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u0645 \u06a9\u0647 migration \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u0645 \u062a\u0627 \u062c\u062f\u0648\u0644 \u062c\u062f\u06cc\u062f \u0631\u0627 \u062f\u0631 \u062f\u06cc\u062a\u0627\u0628\u06cc\u0633\u0627\u0646 \u0628\u0633\u0627\u0632\u06cc\u0645. \u0628\u0646\u0627\u0628\u0631\u0627\u06cc\u0646 \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\r\n

      php artisan migrate<\/p>\r\n

        \r\n
      • \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u067e\u0627\u0633\u067e\u0648\u0631\u062a<\/strong><\/li>\r\n<\/ul>\r\n

        \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0631\u062d\u0644\u0647\u060c \u0645\u0627 \u0645\u062c\u0628\u0648\u0631 \u0647\u0633\u062a\u06cc\u0645 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0627 \u0631\u0648\u06cc \u0633\u0647 \u0641\u0627\u06cc\u0644\u060c \u0645\u062f\u0644\u060c service provider \u0648 auth config \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u0645. \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a \u0631\u0627 \u062f\u0631 \u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0647\u0627 \u062f\u0646\u0628\u0627\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\r\n

          \r\n
        • \u062f\u0631 \u0645\u062f\u0644 \u0645\u0627 \u06a9\u0644\u0627\u0633 HasApiTokens \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645.<\/li>\r\n
        • \u062f\u0631 AuthServiceProvider \u0627\u06cc\u0646 \u0639\u0628\u0627\u0631\u062a \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645 Passport::routes().<\/li>\r\n
        • \u062f\u0631 php \u0645\u0627 api auth \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645.<\/li>\r\n<\/ul>\r\n

          app\/User.php<\/p>\r\n

          <?php\r\n\r\nnamespace App\r\n\r\nuse Illuminate\\Notifications\\Notifiable;\r\n\r\nuse Illuminate\\Contracts\\Auth\\MustVerifyEmail;\r\n\r\nuse Laravel\\Passport\\HasApiTokens;\r\n\r\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\r\n\r\n\r\n\r\n\r\nclass User extends Authenticatable implements MustVerifyEmail\r\n\r\n{\r\n\r\n    use HasApiTokens, Notifiable;\r\n\r\n\r\n\r\n\r\n    \/**\r\n\r\n     * The attributes that are mass assignable.\r\n\r\n     *\r\n\r\n     * @var array\r\n\r\n     *\/\r\n\r\n    protected $fillable = [\r\n\r\n        'name', 'email', 'password',\r\n\r\n    ];\r\n\r\n\r\n\r\n\r\n    \/**\r\n\r\n     * The attributes that should be hidden for arrays.\r\n\r\n     *\r\n\r\n     * @var array\r\n\r\n     *\/\r\n\r\n    protected $hidden = [\r\n\r\n        'password', 'remember_token',\r\n\r\n    ];\r\n}<\/pre>\r\n

          app\/Providers\/AuthServiceProvider.php<\/p>\r\n

          <?php\r\n\r\nnamespace App\\Providers;\r\n\r\n\r\nuse Laravel\\Passport\\Passport;\r\n\r\nuse Illuminate\\Support\\Facades\\Gate;\r\n\r\nuse Illuminate\\Foundation\\Support\\Providers\\AuthServiceProvider as ServiceProvider;\r\n\r\n\r\n\r\n\r\nclass AuthServiceProvider extends ServiceProvider\r\n\r\n{\r\n\r\n    \/**\r\n\r\n     * The policy mappings for the application.\r\n\r\n     *\r\n\r\n     * @var array\r\n\r\n     *\/\r\n\r\n    protected $policies = [\r\n\r\n        'App\\Model' => 'App\\Policies\\ModelPolicy',\r\n\r\n    ];\r\n\r\n\r\n\r\n\r\n    \/**\r\n\r\n     * Register any authentication \/ authorization services.\r\n\r\n     *\r\n\r\n     * @return void\r\n\r\n     *\/\r\n\r\n    public function boot()\r\n\r\n    {\r\n\r\n        $this->registerPolicies();\r\n\r\n\r\n\r\n\r\n        Passport::routes();\r\n\r\n    }\r\n\r\n}<\/pre>\r\n

          config\/auth.php<\/p>\r\n

          <?php\r\n\r\n\r\n\r\n\r\nreturn [\r\n\r\n    .....\r\n\r\n    'guards' => [\r\n\r\n        'web' => [\r\n\r\n            'driver' => 'session',\r\n\r\n            'provider' => 'users',\r\n\r\n        ],\r\n\r\n        'api' => [\r\n\r\n            'driver' => 'passport',\r\n\r\n            'provider' => 'users',\r\n\r\n        ],\r\n\r\n    ],\r\n\r\n    .....\r\n\r\n]\r\n\r\n\r\n<\/pre>\r\n

           <\/p>\r\n

           <\/p>\r\n

            \r\n
          • \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 \u062c\u062f\u0648\u0644 \u0645\u062d\u0635\u0648\u0644 \u0648 \u0645\u062f\u0644<\/strong>: <\/strong><\/li>\r\n<\/ul>\r\n

            \u0633\u067e\u0633\u060c \u0645\u0627 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u0645 \u06a9\u0647 migration \u0631\u0627 \u0628\u0631\u0627\u06cc \u062c\u062f\u0648\u0644 \u0646\u0648\u0634\u062a\u0647 \u0647\u0627 \u062f\u0631 \u0644\u0627\u0631\u0627\u0648\u0644 \u06f5\u066b\u06f7 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062f\u0633\u062a\u0648\u0631 artisan \u0628\u0633\u0627\u0632\u06cc\u0645\u060c \u067e\u0633 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\r\n

            php artisan make:migration create_products_table<\/p>\r\n

            \u0628\u0639\u062f \u0627\u0632 \u0627\u06cc\u0646 \u062f\u0633\u062a\u0648\u0631 \u0634\u0645\u0627 \u06cc\u06a9 \u0641\u0627\u06cc\u0644 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0633\u06cc\u0631 \u067e\u06cc\u062f\u0627 \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f database\/migrations<\/strong> \u0648 \u0634\u0645\u0627 \u0628\u0627\u06cc\u062f \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0641\u0627\u06cc\u0644 migration \u0628\u0631\u0627\u06cc \u0633\u0627\u062e\u062a \u062c\u062f\u0648\u0644 products \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f.<\/p>\r\n

             <\/p>\r\n

            <?php\r\n\r\n\r\n\r\n\r\nuse Illuminate\\Support\\Facades\\Schema;\r\n\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\n\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\n\r\n\r\n\r\n\r\nclass CreateProductsTable extends Migration\r\n\r\n{\r\n\r\n    \/**\r\n\r\n     * Run the migrations.\r\n\r\n     *\r\n\r\n     * @return void\r\n\r\n     *\/\r\n\r\n    public function up()\r\n\r\n    {\r\n\r\n        Schema::create('products', function (Blueprint $table) {\r\n\r\n            $table->increments('id');\r\n\r\n            $table->string('name');\r\n\r\n            $table->text('detail');\r\n\r\n            $table->timestamps();\r\n\r\n        });\r\n\r\n    }\r\n\r\n\r\n\r\n\r\n    \/**\r\n\r\n     * Reverse the migrations.\r\n\r\n     *\r\n\r\n     * @return void\r\n\r\n     *\/\r\n\r\n    public function down()\r\n\r\n    {\r\n\r\n        Schema::dropIfExists('products');\r\n\r\n    }\r\n\r\n}<\/pre>\r\n

            \u00a0<\/p>\r\n

            \u00a0<\/p>\r\n

            \u0633\u067e\u0633 \u0628\u0631\u0627\u06cc \u0627\u062c\u0631\u0627\u06cc \u06a9\u062f \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u062e\u0637 \u0641\u0631\u0645\u0627\u0646 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f<\/p>\r\n

            php artisan migrate<\/p>\r\n

            \u0628\u0639\u062f \u0627\u0632 \u0627\u06cc\u0646 \u06a9\u0647 \u062c\u062f\u0648\u0644 \u0631\u0627 \u0633\u0627\u062e\u062a\u06cc\u062f \u0634\u0645\u0627 \u0628\u0627\u06cc\u062f \u0645\u062f\u0644 Product \u0631\u0627 \u0628\u0631\u0627\u06cc \u0622\u0646 \u0628\u0633\u0627\u0632\u06cc\u062f\u060c \u0627\u0628\u062a\u062f\u0627 \u0641\u0627\u06cc\u0644 \u0631\u0627 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0633\u06cc\u0631 \u0628\u0633\u0627\u0632\u06cc\u062f app\/Product.php \u0648 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0622\u0646 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f:<\/p>\r\n

            <?php\r\n\r\nnamespace App;\r\n\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\n\r\n\r\n\r\nclass Product extends Model\r\n\r\n{\r\n\r\n    \/**\r\n\r\n     * The attributes that are mass assignable.\r\n\r\n     *\r\n\r\n     * @var array\r\n\r\n     *\/\r\n\r\n    protected $fillable = [\r\n\r\n        'name', 'detail'\r\n\r\n    ];\r\n\r\n}\r\n\r\n<\/pre>\r\n
              \r\n
            • \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0631\u062d\u0644\u0647 \u0645\u0627 \u0631\u0648\u062a \u0631\u0627 \u0645\u06cc \u0633\u0627\u0632\u06cc\u0645 \u0644\u0627\u0631\u0627\u0648\u0644 \u0641\u0627\u06cc\u0644 php \u0631\u0627 \u0628\u0631\u0627\u06cc \u0646\u0648\u0634\u062a\u0646 \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0641\u0631\u0627\u0647\u0645 \u06a9\u0631\u062f\u0647 \u0627\u0633\u062a. \u067e\u0633 \u0628\u06cc\u0627\u06cc\u062f \u06cc\u06a9 \u0631\u0648\u062a \u062c\u062f\u06cc\u062f \u062f\u0631 \u0627\u06cc\u0646 \u0641\u0627\u06cc\u0644 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645. \u06a9\u062f \u0647\u0627\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0633\u06cc\u0631 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f :<\/li>\r\n<\/ul>\r\n

              routes\/api.php<\/p>\r\n

              <?php\r\n\r\n\/*\r\n\r\n|--------------------------------------------------------------------------\r\n\r\n| API Routes\r\n\r\n|--------------------------------------------------------------------------\r\n\r\n|\r\n\r\n| Here is where you can register API routes for your application. These\r\n\r\n| routes are loaded by the RouteServiceProvider within a group which\r\n\r\n| is assigned the \"api\" middleware group. Enjoy building your API!\r\n\r\n|\r\n\r\n*\/\r\n\r\nRoute::post('register', 'API\\RegisterController@register');\r\n\r\nRoute::middleware('auth:api')->group( function () {\r\n\r\n       Route::resource('products', 'API\\ProductController');\r\n\r\n});<\/pre>\r\n

               <\/p>\r\n

                \r\n
              • \u0633\u0627\u062e\u062a \u0641\u0627\u06cc\u0644 <\/strong>Controller<\/strong><\/li>\r\n<\/ul>\r\n

                \u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0628\u0639\u062f\u06cc\u060c \u0645\u0627 \u0686\u0646\u062f \u06a9\u0646\u062a\u0631\u0644 \u062c\u062f\u06cc\u062f \u0628\u0647 \u0627\u06cc\u0646 \u0646\u0627\u0645 \u0647\u0627 \u0645\u06cc \u0633\u0627\u0632\u06cc\u0645: BaseController\u060c ProductController \u0648 RegisterController. \u0645\u0646 \u06cc\u06a9 \u067e\u0648\u0634\u0647 \u062c\u062f\u06cc\u062f \u0633\u0627\u062e\u062a\u0645 \u0628\u0647 \u0646\u0627\u0645 API \u0648 \u067e\u0648\u0634\u0647 Controllers \u0632\u06cc\u0631\u0627 \u0645\u0627 \u0641\u0642\u0637 \u06a9\u0646\u062a\u0631\u0644\u0631 \u0647\u0627\u06cc api \u0631\u0627 \u062f\u0631 \u0622\u0646 \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u06cc\u0645.<\/p>\r\n

                app\/Http\/Controllers\/API\/BaseController.php<\/p>\r\n

                <?php\r\n\r\n\r\n\r\n\r\nnamespace App\\Http\\Controllers\\API;\r\n\r\n\r\n\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nuse App\\Http\\Controllers\\Controller as Controller;\r\n\r\n\r\n\r\n\r\nclass BaseController extends Controller\r\n\r\n{\r\n\r\n    \/**\r\n\r\n     * success response method.\r\n\r\n     *\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function sendResponse($result, $message)\r\n\r\n    {\r\n\r\n       $response = [\r\n\r\n            'success' => true,\r\n\r\n            'data'    => $result,\r\n\r\n            'message' => $message,\r\n\r\n        ];\r\n\r\n\r\n\r\n\r\n        return response()->json($response, 200);\r\n\r\n    }\r\n\r\n\r\n\r\n\r\n    \/**\r\n\r\n     * return error response.\r\n\r\n     *\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function sendError($error, $errorMessages = [], $code = 404)\r\n\r\n    {\r\n\r\n       $response = [\r\n\r\n            'success' => false,\r\n\r\n            'message' => $error,\r\n\r\n        ];\r\n\r\n\r\n\r\n\r\n        if(!empty($errorMessages)){\r\n\r\n            $response['data'] = $errorMessages;\r\n\r\n        }\r\n\r\n\r\n\r\n\r\n        return response()->json($response, $code);\r\n\r\n    }\r\n\r\n}<\/pre>\r\n

                app\/Http\/Controllers\/API\/ProductController.php<\/p>\r\n

                <?php\r\n\r\nnamespace App\\Http\\Controllers\\API;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nuse App\\Http\\Controllers\\API\\BaseController as BaseController;\r\n\r\nuse App\\Product;\r\n\r\nuse Validator;\r\n\r\nclass ProductController extends BaseController\r\n\r\n{\r\n\r\n    \/**\r\n\r\n     * Display a listing of the resource.\r\n\r\n     *\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function index()\r\n\r\n    {\r\n\r\n        $products = Product::all();\r\n\r\n        return $this->sendResponse($products->toArray(), 'Products retrieved successfully.');\r\n\r\n    }\r\n\r\n    \/**\r\n\r\n     * Store a newly created resource in storage.\r\n\r\n     *\r\n\r\n     * @param  \\Illuminate\\Http\\Request  $request\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function store(Request $request)\r\n\r\n    {\r\n\r\n        $input = $request->all();\r\n\r\n        $validator = Validator::make($input, [\r\n\r\n            'name' => 'required',\r\n\r\n            'detail' => 'required'\r\n\r\n        ]);\r\n\r\n        if($validator->fails()){\r\n\r\n            return $this->sendError('Validation Error.', $validator->errors());      \r\n\r\n        }\r\n\r\n        $product = Product::create($input);\r\n\r\n        return $this->sendResponse($product->toArray(), 'Product created successfully.');\r\n\r\n    }\r\n\r\n    \/**\r\n\r\n     * Display the specified resource.\r\n\r\n     *\r\n\r\n     * @param  int  $id\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function show($id)\r\n\r\n    {\r\n\r\n        $product = Product::find($id);\r\n\r\n        if (is_null($product)) {\r\n\r\n            return $this->sendError('Product not found.');\r\n\r\n        }\r\n\r\n        return $this->sendResponse($product->toArray(), 'Product retrieved successfully.');\r\n\r\n    }\r\n\r\n    \/**\r\n\r\n     * Update the specified resource in storage.\r\n\r\n     *\r\n\r\n     * @param  \\Illuminate\\Http\\Request  $request\r\n\r\n     * @param  int  $id\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function update(Request $request, Product $product)\r\n\r\n    {\r\n\r\n        $input = $request->all();\r\n\r\n        $validator = Validator::make($input, [\r\n\r\n            'name' => 'required',\r\n\r\n            'detail' => 'required'\r\n\r\n        ]);\r\n\r\n        if($validator->fails()){\r\n\r\n            return $this->sendError('Validation Error.', $validator->errors());      \r\n\r\n        }\r\n\r\n        $product->name = $input['name'];\r\n\r\n        $product->detail = $input['detail'];\r\n\r\n        $product->save();\r\n\r\n        return $this->sendResponse($product->toArray(), 'Product updated successfully.');\r\n\r\n    }\r\n\r\n    \/**\r\n\r\n     * Remove the specified resource from storage.\r\n\r\n     *\r\n\r\n     * @param  int  $id\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function destroy(Product $product)\r\n\r\n    {\r\n\r\n        $product->delete();\r\n\r\n        return $this->sendResponse($product->toArray(), 'Product deleted successfully.');\r\n\r\n    }\r\n\r\n}<\/pre>\r\n

                 <\/p>\r\n

                app\/Http\/Controllers\/API\/RegisterController.php<\/p>\r\n

                <?php\r\n\r\nnamespace App\\Http\\Controllers\\API;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nuse App\\Http\\Controllers\\API\\BaseController as BaseController;\r\n\r\nuse App\\User;\r\n\r\nuse Illuminate\\Support\\Facades\\Auth;\r\n\r\nuse Validator;\r\n\r\nclass RegisterController extends BaseController\r\n\r\n{\r\n\r\n    \/**\r\n\r\n     * Register api\r\n\r\n     *\r\n\r\n     * @return \\Illuminate\\Http\\Response\r\n\r\n     *\/\r\n\r\n    public function register(Request $request)\r\n\r\n    {\r\n\r\n        $validator = Validator::make($request->all(), [\r\n\r\n            'name' => 'required',\r\n\r\n            'email' => 'required|email',\r\n\r\n            'password' => 'required',\r\n\r\n            'c_password' => 'required|same:password',\r\n\r\n        ]);\r\n\r\n        if($validator->fails()){\r\n\r\n            return $this->sendError('Validation Error.', $validator->errors());      \r\n\r\n        }\r\n\r\n        $input = $request->all();\r\n\r\n        $input['password'] = bcrypt($input['password']);\r\n\r\n        $user = User::create($input);\r\n\r\n        $success['token'] =  $user->createToken('MyApp')->accessToken;\r\n\r\n        $success['name'] =  $user->name;\r\n\r\n        return $this->sendResponse($success, 'User register successfully.');\r\n\r\n    }\r\n\r\n}<\/pre>\r\n

                 <\/p>\r\n

                \u062d\u0627\u0644\u0627 \u0645\u0627 \u0622\u0645\u0627\u062f\u0647 \u0647\u0633\u062a\u06cc\u0645 \u06a9\u0647 restful api \u0648 passport api \u0631\u0627 \u062f\u0631 \u0644\u0627\u0631\u0627\u0648\u0644 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u0645 . \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0645\u0646\u0638\u0648\u0631 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 \u062e\u0637 \u0641\u0631\u0645\u0627\u0646 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f<\/p>\r\n

                php artisan serve<\/p>\r\n

                \u062d\u0627\u0644 \u0628\u0631\u0627\u06cc \u0645\u0634\u0627\u0647\u062f\u0647 \u0639\u0645\u0644\u06cc\u0627\u062a \u0627\u0646\u062c\u0627\u0645 \u0634\u062f\u0647 header \u0631\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u062a\u0646\u0638\u06cc\u0645 \u0646\u0645\u0627\u06cc\u06cc\u062f:<\/p>\r\n

                'headers' => [\r\n\r\n    'Accept' => 'application\/json',\r\n\r\n    'Authorization' => 'Bearer '.$accessToken,\r\n\r\n]<\/pre>\r\n

                 <\/p>\r\n

                \u0633\u067e\u0633 \u0628\u0631\u0627\u06cc \u0645\u0634\u0627\u0647\u062f\u0647 \u062e\u0631\u0648\u062c\u06cc \u0647\u0631 \u06cc\u06a9 \u0627\u0632 \u0644\u06cc\u0646\u06a9 \u0647\u0627\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 postman \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f<\/p>\r\n

                \u06f1) Login: Verb:GET, URL:http:\/\/localhost:8000\/oauth\/token<\/p>\r\n

                \u06f2) Register: Verb:GET, URL:http:\/\/localhost:8000\/api\/register<\/p>\r\n

                \u06f3) List: Verb:GET, URL:http:\/\/localhost:8000\/api\/products<\/p>\r\n

                \u06f4) Create: Verb:POST, URL:http:\/\/localhost:8000\/api\/products<\/p>\r\n

                \u06f5) Show: Verb:GET, URL:http:\/\/localhost:8000\/api\/products\/{id}<\/p>\r\n

                \u06f6) Update: Verb:PUT, URL:http:\/\/localhost:8000\/api\/products\/{id}<\/p>\r\n

                \u06f7) Delete: Verb:DELETE, URL:http:\/\/localhost:8000\/api\/products\/{id}<\/p>\r\n

                 <\/p>\r\n

                 <\/p>\r\n\r\n\r\n\r\n

                 <\/p>\r\n","protected":false},"excerpt":{"rendered":"

                \u0633\u0627\u062e\u062a \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0644\u0627\u0631\u0627\u0648\u0644 \u06f5\u066b\u06f7 API \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0648\u0628 \u0633\u0631\u0648\u06cc\u0633 \u0634\u0646\u0627\u062e\u062a\u0647 \u0645\u06cc \u0634\u0648\u062f. \u0622\u06cc\u0627 \u0634\u0645\u0627 \u062f\u0646\u0628\u0627\u0644 \u0627\u06cc\u0646 \u0645\u06cc \u06a9\u0631\u062f\u06cc\u0646 \u06a9\u0647 \u0686\u0637\u0648\u0631 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0631 \u0644\u0627\u0631\u0627\u0648\u0644 \u06f5\u066b\u06f7 \u0645\u06cc\u0634\u0647 restful api \u0633\u0627\u062e\u062a\u061f \u0627\u06af\u0631 \u0628\u0644\u0647 \u0645\u0646 \u0627\u06cc\u0646\u062c\u0627 \u0642\u062f\u0645 \u0628\u0647 \u0642\u062f\u0645 \u0622\u0645\u0648\u0632\u0634 \u0622\u0646 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0634\u0645\u0627 \u0646\u0648\u0634\u062a\u0647 \u0627\u0645 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u0628\u0627 \u067e\u0627\u0633\u067e\u0648\u0631\u062a. \u0627\u0645\u0631\u0648\u0632\u0647\u060c<\/p>\n","protected":false},"author":1,"featured_media":1334,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,34],"tags":[38,36,35,37],"yst_prominent_words":[75,79,67,81,76,82,71,66,68,65,83,69,74,78,80,70,72,84,73,77],"_links":{"self":[{"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/posts\/1278"}],"collection":[{"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/comments?post=1278"}],"version-history":[{"count":0,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/posts\/1278\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/media\/1334"}],"wp:attachment":[{"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/media?parent=1278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/categories?post=1278"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/tags?post=1278"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"http:\/\/targostar.net\/wp-json\/wp\/v2\/yst_prominent_words?post=1278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}