This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pod 'CustomUISwitch', :path => "[PATH_TO_YOUR_LOCAL_FOLDER]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pod init | |
open -a Xcode Podfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pod::Spec.new do |spec| | |
#1 | |
spec.name = "CustomUISwitch" | |
spec.version = "0.0.1" | |
spec.summary = "Customizable switch." | |
spec.description = <<-DESC | |
Switch is a pod that contains code for creating customizable UI Switch element. | |
DESC | |
spec.homepage = "http://www.factory.hr" | |
#2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pod spec create CustomUISwitch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Schema::create('movies', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->string('name'); | |
$table->text('description'); | |
$table->integer('year'); | |
$table->float('rating'); | |
$table->string('image')->nullable(); | |
$table->timestamps(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function search(Request $request) | |
{ | |
if($request->has('text') && $request->input('text')) { | |
// Search for given text and return data | |
$data = $this->searchMovies($request->input('text')); | |
$moviesArray = []; | |
// If there are any movies that match given search text "hits" fill their id's in array | |
if($data['hits']['total'] > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fill array with movie data | |
$data = [ | |
'body' => [ | |
'id' => $movie->id, | |
'name' => $movie->name, | |
'year' => $movie->year, | |
'description' => $movie->description, | |
'rating' => $movie->rating, | |
'actors' => implode(',', $movie->movie_actors->pluck('name')->toArray()) | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$movies = Movie::all(); | |
foreach ($movies as $movie) { | |
// Add index and type data to array | |
// Movie::ELASTIC_INDEX => movies | |
// Movie::ELASTIC_TYPE => movie | |
$data['body'][] = [ | |
'index' => [ | |
'_index' => Movie::ELASTIC_INDEX, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:overScrollMode="never"> | |
<RelativeLayout | |
android:id="@+id/rlProgress" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:overScrollMode="never"> | |
<RelativeLayout | |
android:id="@+id/rlProgress" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> |