护照-以编程方式创建客户端凭据授予客户端

时间:2019-10-31 11:23:28

标签: laravel oauth laravel-passport clientcredential

文档Here建议php artisan passport:client --client用于创建客户端,但是我想使用控制器来实现,或者理想情况下,要使用通行证提供的本机JSON API。 可能吗?还是我必须重写Passport::client中的方法?

1 个答案:

答案 0 :(得分:0)

你可以

const App = () => {
  const [itemsAmount] = useState(1000); 
  const [keys, setKeys] = useState([]);
  const [products, setProducts] = useState([]);
  const [currentPage, setCurrentPage] = useState(1);
  const [productsPerPage, setProductsPerPage] = useState(10); 

  /* Get current products*/
  const indexOfLastProduct = currentPage * productsPerPage;
  const indexOfFirstProduct = indexOfLastProduct - productsPerPage;
  const currentProducts = products.slice(indexOfFirstProduct, indexOfLastProduct);

  /* Change page */
  const pagesCount = Math.ceil(products.length / productsPerPage)

<div className="">
        <ReactPaginate
          previousLabel = {'Previous'}
          nextLabel = {'Next'}
          breakLabel = {' ... '}
          pageCount = {pagesCount}
          onPageChange={ (data) => { setCurrentPage(data.selected+1)} }
          containerClassName={'pagination'}
          subContainerClassName={'pages pagination'}
          activeClassName={'active'}
        />
      <Products products={currentProducts} keys={keys} />
  </div>
}

Artisan