Esempio n. 1
0
 public function search(MyFontsSource $source, $term = '')
 {
     $settings = ['sort' => 'popularity', 'sort_type' => 'desc', 'ipp' => 10, 'extra_data' => 'details'];
     $imageSettings = ['format' => 'png', 'transparent' => 'true', 'width' => 550, 'size' => session('sample_size') ? session('sample_size') : 80, 'text' => session('sample_text') ? session('sample_text') : 'Quick brown fox jums over a lazy dog'];
     if (!empty(trim($term))) {
         $settings['name'] = $term;
     }
     $data = $source->families($settings, $imageSettings);
     $fonts = $data->total_results > 0 ? $data->results : [];
     return view('components._font-search-results', compact('fonts'));
 }
Esempio n. 2
0
 /**
  * Shows edit project page
  *
  * @param Project $project
  * @param MyFontsSource $source
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function edit(Project $project, MyFontsSource $source)
 {
     $fonts = $source->families(['sort' => 'popularity', 'sort_type' => 'desc', 'ipp' => 10, 'extra_data' => 'styles|details']);
     return view('projects.edit', ['project' => $project, 'fonts' => $fonts->results, 'edit' => true]);
 }